GNU bug report logs - #9203
24.0.50; some Clang experience

Previous Next

Package: emacs;

Reported by: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>

Date: Sat, 30 Jul 2011 11:54:01 UTC

Severity: normal

Found in version 24.0.50

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9203 in the body.
You can then email your comments to 9203 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9203; Package emacs. (Sat, 30 Jul 2011 11:54:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Dyballa <Peter_Dyballa <at> Freenet.DE>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 30 Jul 2011 11:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; some Clang experience
Date: Sat, 30 Jul 2011 13:53:30 +0200
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





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9203; Package emacs. (Sat, 30 Jul 2011 12:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 9203 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
Cc: 9203 <at> debbugs.gnu.org
Subject: Re: bug#9203: 24.0.50; some Clang experience
Date: Sat, 30 Jul 2011 15:27:06 +0300
> From: Peter Dyballa <Peter_Dyballa <at> 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?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9203; Package emacs. (Sat, 30 Jul 2011 12:59:02 GMT) Full text and rfc822 format available.

Message #11 received at 9203 <at> debbugs.gnu.org (full text, mbox):

From: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9203 <at> debbugs.gnu.org
Subject: Re: bug#9203: 24.0.50; some Clang experience
Date: Sat, 30 Jul 2011 14:58:28 +0200
Am 30.07.2011 um 14:27 schrieb Eli Zaretskii:

>> From: Peter Dyballa <Peter_Dyballa <at> 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.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9203; Package emacs. (Sat, 30 Jul 2011 13:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 9203 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>, 9203 <at> debbugs.gnu.org
Subject: Re: bug#9203: 24.0.50; some Clang experience
Date: Sat, 30 Jul 2011 15:22:11 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Peter Dyballa <Peter_Dyballa <at> 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 <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9203; Package emacs. (Sat, 30 Jul 2011 13:32:01 GMT) Full text and rfc822 format available.

Message #17 received at 9203 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Peter_Dyballa <at> Freenet.DE, 9203 <at> debbugs.gnu.org
Subject: Re: bug#9203: 24.0.50; some Clang experience
Date: Sat, 30 Jul 2011 16:31:32 +0300
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Peter Dyballa <Peter_Dyballa <at> Freenet.DE>,  9203 <at> 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'.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9203; Package emacs. (Sat, 30 Jul 2011 13:50:02 GMT) Full text and rfc822 format available.

Message #20 received at 9203 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Peter_Dyballa <at> Freenet.DE, 9203 <at> debbugs.gnu.org
Subject: Re: bug#9203: 24.0.50; some Clang experience
Date: Sat, 30 Jul 2011 15:49:32 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> `ret' is the value returned by regexec

No, it isn't.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9203; Package emacs. (Sat, 30 Jul 2011 14:12:02 GMT) Full text and rfc822 format available.

Message #23 received at 9203 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Peter_Dyballa <at> Freenet.DE, 9203 <at> debbugs.gnu.org
Subject: Re: bug#9203: 24.0.50; some Clang experience
Date: Sat, 30 Jul 2011 17:11:00 +0300
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Peter_Dyballa <at> Freenet.DE,  9203 <at> debbugs.gnu.org
> Date: Sat, 30 Jul 2011 15:49:32 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > `ret' is the value returned by regexec
> 
> No, it isn't.

Grow up, will you?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9203; Package emacs. (Sat, 30 Jul 2011 14:35:02 GMT) Full text and rfc822 format available.

Message #26 received at 9203 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Peter_Dyballa <at> Freenet.DE, 9203 <at> debbugs.gnu.org
Subject: Re: bug#9203: 24.0.50; some Clang experience
Date: Sat, 30 Jul 2011 16:33:51 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Andreas Schwab <schwab <at> linux-m68k.org>
>> Cc: Peter_Dyballa <at> Freenet.DE,  9203 <at> debbugs.gnu.org
>> Date: Sat, 30 Jul 2011 15:49:32 +0200
>> 
>> Eli Zaretskii <eliz <at> 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 <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Reply sent to Tom Tromey <tom <at> tromey.com>:
You have taken responsibility. (Tue, 22 Dec 2015 03:45:02 GMT) Full text and rfc822 format available.

Notification sent to Peter Dyballa <Peter_Dyballa <at> Freenet.DE>:
bug acknowledged by developer. (Tue, 22 Dec 2015 03:45:02 GMT) Full text and rfc822 format available.

Message #31 received at 9203-done <at> debbugs.gnu.org (full text, mbox):

From: Tom Tromey <tom <at> tromey.com>
To: 9203-done <at> debbugs.gnu.org
Subject: bug#9203: 24.0.50; some Clang experience
Date: Mon, 21 Dec 2015 20:44:30 -0700
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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Jan 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.