* bug#9203: 24.0.50; some Clang experience
@ 2011-07-30 11:53 Peter Dyballa
2011-07-30 12:27 ` Eli Zaretskii
2015-12-22 3:44 ` Tom Tromey
0 siblings, 2 replies; 9+ messages in thread
From: Peter Dyballa @ 2011-07-30 11:53 UTC (permalink / raw)
To: 9203
Hello!
When using
Apple clang version 2.0 (tags/Apple/clang-139) (based on LLVM 2.9svn)
Target: x86_64-apple-darwin10
Thread model: posix
to compile GNU Emacs on Mac OS X 10.6.8 with intel Core i7 it warns about some statements:
emacs-24.0.50/lib-src/../src/regex.c:6603:15: warning:
comparison of unsigned enum expression >= 0 is always true [-Wtautological-compare]
if (ret >= 0)
~~~ ^ ~
emacs-24.0.50/lib-src/../src/regex.c:6619:14: warning:
comparison of unsigned enum expression >= 0 is always true [-Wtautological-compare]
return ret >= 0 ? REG_NOERROR : REG_NOMATCH;
~~~ ^ ~
emacs-24.0.50/lib-src/emacsclient.c:1269:52: warning:
passing 'const char *' to parameter of type 'char *' discards qualifiers
confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
^~~~~~
In file included from emacs-24.0.50/lib-src/emacsclient.c:76:
In file included from ../lib/getopt.h:31:
In file included from /usr/include/getopt.h:44:
In file included from ../lib/unistd.h:43:
/usr/include/unistd.h:423:28: note: passing argument to parameter here
size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr);
^
The installed NS variant is a bit unstable. Maybe I just need to optimise the compiler switches in the near future!
--
Greetings
Pete
I hope to die before I *have* to use Microsoft Word.
- Donald E. Knuth, 2001-10-02 in Tübingen
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#9203: 24.0.50; some Clang experience
2011-07-30 11:53 bug#9203: 24.0.50; some Clang experience Peter Dyballa
@ 2011-07-30 12:27 ` Eli Zaretskii
2011-07-30 12:58 ` Peter Dyballa
2011-07-30 13:22 ` Andreas Schwab
2015-12-22 3:44 ` Tom Tromey
1 sibling, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2011-07-30 12:27 UTC (permalink / raw)
To: Peter Dyballa; +Cc: 9203
> From: Peter Dyballa <Peter_Dyballa@Freenet.DE>
> Date: Sat, 30 Jul 2011 13:53:30 +0200
>
> When using
>
> Apple clang version 2.0 (tags/Apple/clang-139) (based on LLVM 2.9svn)
> Target: x86_64-apple-darwin10
> Thread model: posix
>
> to compile GNU Emacs on Mac OS X 10.6.8 with intel Core i7 it warns about some statements:
>
> emacs-24.0.50/lib-src/../src/regex.c:6603:15: warning:
> comparison of unsigned enum expression >= 0 is always true [-Wtautological-compare]
> if (ret >= 0)
> ~~~ ^ ~
`ret' is of the type `reg_errcode_t', which is an enumerated data
type, so its signedness is implementation-defined, AFAIK. Why did you
use that particular warning option?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#9203: 24.0.50; some Clang experience
2011-07-30 12:27 ` Eli Zaretskii
@ 2011-07-30 12:58 ` Peter Dyballa
2011-07-30 13:22 ` Andreas Schwab
1 sibling, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2011-07-30 12:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 9203
Am 30.07.2011 um 14:27 schrieb Eli Zaretskii:
>> From: Peter Dyballa <Peter_Dyballa@Freenet.DE>
>> Date: Sat, 30 Jul 2011 13:53:30 +0200
>>
>> When using
>>
>> Apple clang version 2.0 (tags/Apple/clang-139) (based on LLVM 2.9svn)
>> Target: x86_64-apple-darwin10
>> Thread model: posix
>>
>> to compile GNU Emacs on Mac OS X 10.6.8 with intel Core i7 it warns about some statements:
>>
>> emacs-24.0.50/lib-src/../src/regex.c:6603:15: warning:
>> comparison of unsigned enum expression >= 0 is always true [-Wtautological-compare]
>> if (ret >= 0)
>> ~~~ ^ ~
>
> `ret' is of the type `reg_errcode_t', which is an enumerated data
> type, so its signedness is implementation-defined, AFAIK. Why did you
> use that particular warning option?
I did not use any. Here is the configure invocation:
env LANG=C PATH=/opt/local/bin:$PATH ./configure --without-sound --without-dbus --without-pop --without-gconf --without-gpm --with-ns --disable-ns-self-contained --enable-locallisppath=/Library/Application\ Support/Emacs/calendar24:/Library/Application\ Support/Emacs CFLAGS="-v -g -H -pipe -fPIC -fno-common -m64 -mtune=core2 -march=core2 -Os -fomit-frame-pointer -foptimize-register-move -ftree-vectorize" LDFLAGS="-Wl,-dead_strip_dylibs -Wl,-bind_at_load -Wl,-t" CC=clang CXX=clang++ PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/opt/local/share/pkgconfig:/usr/lib/pkgconfig
I thick Clang tells us how to avoid such reports. At least I don't get the one cited when I add -Wtautological-compare to the CFLAGS and configure and compile.
Purpose of my report is merely to point to possibly unclean code. Clangs really reports a lot!
--
Greetings
Pete
There are three types of people in this world: those who can count, and those who cannot.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#9203: 24.0.50; some Clang experience
2011-07-30 12:27 ` Eli Zaretskii
2011-07-30 12:58 ` Peter Dyballa
@ 2011-07-30 13:22 ` Andreas Schwab
2011-07-30 13:31 ` Eli Zaretskii
1 sibling, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2011-07-30 13:22 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Peter Dyballa, 9203
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Peter Dyballa <Peter_Dyballa@Freenet.DE>
>> Date: Sat, 30 Jul 2011 13:53:30 +0200
>>
>> When using
>>
>> Apple clang version 2.0 (tags/Apple/clang-139) (based on LLVM 2.9svn)
>> Target: x86_64-apple-darwin10
>> Thread model: posix
>>
>> to compile GNU Emacs on Mac OS X 10.6.8 with intel Core i7 it warns about some statements:
>>
>> emacs-24.0.50/lib-src/../src/regex.c:6603:15: warning:
>> comparison of unsigned enum expression >= 0 is always true [-Wtautological-compare]
>> if (ret >= 0)
>> ~~~ ^ ~
>
> `ret' is of the type `reg_errcode_t', which is an enumerated data
> type, so its signedness is implementation-defined, AFAIK.
But re_search returns regoff_t, so the type is wrong.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#9203: 24.0.50; some Clang experience
2011-07-30 13:22 ` Andreas Schwab
@ 2011-07-30 13:31 ` Eli Zaretskii
2011-07-30 13:49 ` Andreas Schwab
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2011-07-30 13:31 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Peter_Dyballa, 9203
> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Peter Dyballa <Peter_Dyballa@Freenet.DE>, 9203@debbugs.gnu.org
> Date: Sat, 30 Jul 2011 15:22:11 +0200
>
> > `ret' is of the type `reg_errcode_t', which is an enumerated data
> > type, so its signedness is implementation-defined, AFAIK.
>
> But re_search returns regoff_t, so the type is wrong.
`ret' is the value returned by regexec, so its type should be
`reg_errcode_t'.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#9203: 24.0.50; some Clang experience
2011-07-30 13:31 ` Eli Zaretskii
@ 2011-07-30 13:49 ` Andreas Schwab
2011-07-30 14:11 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2011-07-30 13:49 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Peter_Dyballa, 9203
Eli Zaretskii <eliz@gnu.org> writes:
> `ret' is the value returned by regexec
No, it isn't.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#9203: 24.0.50; some Clang experience
2011-07-30 13:49 ` Andreas Schwab
@ 2011-07-30 14:11 ` Eli Zaretskii
2011-07-30 14:33 ` Andreas Schwab
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2011-07-30 14:11 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Peter_Dyballa, 9203
> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Peter_Dyballa@Freenet.DE, 9203@debbugs.gnu.org
> Date: Sat, 30 Jul 2011 15:49:32 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > `ret' is the value returned by regexec
>
> No, it isn't.
Grow up, will you?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#9203: 24.0.50; some Clang experience
2011-07-30 14:11 ` Eli Zaretskii
@ 2011-07-30 14:33 ` Andreas Schwab
0 siblings, 0 replies; 9+ messages in thread
From: Andreas Schwab @ 2011-07-30 14:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Peter_Dyballa, 9203
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Cc: Peter_Dyballa@Freenet.DE, 9203@debbugs.gnu.org
>> Date: Sat, 30 Jul 2011 15:49:32 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > `ret' is the value returned by regexec
>>
>> No, it isn't.
>
> Grow up, will you?
Don't make you look silly.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#9203: 24.0.50; some Clang experience
2011-07-30 11:53 bug#9203: 24.0.50; some Clang experience Peter Dyballa
2011-07-30 12:27 ` Eli Zaretskii
@ 2015-12-22 3:44 ` Tom Tromey
1 sibling, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2015-12-22 3:44 UTC (permalink / raw)
To: 9203-done
I looked at the warnings here and from what I can tell they've all been
fixed.
The regex.c one was fixed by correcting the type of 'ret'.
The emacsclient.c one was fixed by introducing tmpdir_storage and
passing it to confstr.
If you still see these warnings, please reply and we can reopen the bug.
thanks,
Tom
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-12-22 3:44 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-30 11:53 bug#9203: 24.0.50; some Clang experience Peter Dyballa
2011-07-30 12:27 ` Eli Zaretskii
2011-07-30 12:58 ` Peter Dyballa
2011-07-30 13:22 ` Andreas Schwab
2011-07-30 13:31 ` Eli Zaretskii
2011-07-30 13:49 ` Andreas Schwab
2011-07-30 14:11 ` Eli Zaretskii
2011-07-30 14:33 ` Andreas Schwab
2015-12-22 3:44 ` Tom Tromey
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).