Warnings about rcs_id strings: let's settle this

Jonathan Lennox lennox@cs.columbia.edu
Fri May 2 17:51:00 GMT 2003


Joe Buck writes:
> As for my answers:
> 
> only for const variables?  NO.  Many old codes do not declare the rcsid
> const, and the fact that we have the flag that will warn about all unused
> static variables means that users can still find them all.

Er, warning about this for non-const static strings is existing practice
with gcc:

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unused-1.c
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20030502/de35ab52/attachment.c>
-------------- next part --------------

$ gcc -Wall -g -O2 unused-1.c 
unused-1.c:3: warning: `unused1' defined but not used
unused-1.c:4: warning: `unused2' defined but not used
unused-1.c:5: warning: `unused3' defined but not used
$ gcc -v
Reading specs from /usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/specs
Configured with: /src/unpack/gnu/gcc-3.2.1/configure --prefix=/opt/CUCSgnu --with-gnu-as --with-as=/opt/CUCSgnu/bin/as --with-gnu-ld --with-ld=/opt/CUCSgnu/bin/ld --enable-languages=c,c++,f77,objc
Thread model: posix
gcc version 3.2.1
$ gcc-2.95.2 -Wall -g -O2 unused-1.c
unused-1.c:3: warning: `unused1' defined but not used
unused-1.c:4: warning: `unused2' defined but not used
unused-1.c:5: warning: `unused3' defined but not used
$ gcc-2.95.2 -v
Reading specs from /usr/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/specs
gcc version 2.95.2 19991024 (release)

-- 
Jonathan Lennox
lennox@cs.columbia.edu


More information about the Gcc mailing list