home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.help
- Path: sparky!uunet!paladin.american.edu!gatech!destroyer!ncar!csn!news.den.mmc.com!traffic!kevin
- From: kevin@traffic.den.mmc.com (Kevin Rodgers)
- Subject: Re: SCCS strings embedded in code with -Wall
- Message-ID: <1993Jan21.195955.598@den.mmc.com>
- Sender: news@den.mmc.com (News)
- Nntp-Posting-Host: traffic.den.mmc.com
- Organization: Martin Marietta Western Internal Systems, Technical Operations
- References: <1993Jan15.201556.9105@picker.com> <bkFYsLbr@twinsun.com>
- Distribution: na
- Date: Thu, 21 Jan 1993 19:59:55 GMT
- Lines: 30
-
- In article <bkFYsLbr@twinsun.com> eggert@twinsun.com (Paul Eggert) writes:
- >parma@sophie.ct.picker.com (Michael J. Parma) writes:
- >
- >>'-Wall' causes the a warning about an unused variable.
- >>We don't want _any_ warning messages if we can help it....
- >>Something that works on any standard compiler would be welcomed
- >
- >The easiest way to prevent the warning is to use the variable. E.g.
- >
- > static char rcsid[] = "$Id: ... $";
- > print_version() { printf("version: %s\n", rcsid); }
-
- print_version() should probably be declared static.
-
- >Some compilers remove `rcsid' from the object file if it's not referenced;
- >you really must use rcsid if you want it to remain in the object file.
-
- Yuck. What about rcs_id, sccsid, sccs_id, etc.?
-
- >So GCC's warning is useful.
-
- I would suggest that an unused variable warning is inappropriate if the
- variable has been initialized, at least if it is declared to be static.
-
- (Should this be moved to gnu.gcc.bug?)
- --
- Kevin Rodgers kevin@traffic.den.mmc.com
- Martin Marietta MS A16401 (303) 790-3971
- 116 Inverness Dr. East
- Englewood CO 80112 USA GO BUFFS!
-