Re: gcc 4.3 warnings
- From: Skunk Worx <skunkworx@xxxxxxxxxxx>
- Date: Thu, 07 Aug 2008 07:54:24 -0700
Matthew Saltzman wrote:
On Wed, 2008-08-06 at 22:34 -0700, Skunk Worx wrote:Matthew Saltzman wrote:On Tue, 2008-08-05 at 19:49 -0700, Skunk Worx wrote:Exactly. This code was written circa 1991 and the warnings came with the change to Fedora 9.$ gcc foo.cA macro definition has to consist of a sequence of tokens. A string
foo.c:1:16: warning: missing terminating " character
$ cat foo.c
#define DQUOTE "
main() {}
A few people at work have mentioned it seems unusual for a preprocessor to complain about simple macros this way.
What do others think of this?
constant (sequence of characters enclosed in double quotes) is a token,
but the double quote by itself is not.
If you are trying to construct strings containing macro defs, look at
the stringize operator (#) and token merge operator (##)in the
preprocessor documentation.
The preprocessor is being used to generate html code documentation in the build, including named anchors (#).
A further review of K&R, and other sources on the web, show the use of the preprocessor for this kind of task is not recommended.
I imagine it would be some effort to integrate in legacy code, but if I
understand what you're trying to do, it sounds like Doxygen might do
what you want. There are other, similar systems out there as well.
They generally use formatted comments and a separate processor to
generate documentation in various formats.
We use doxygen in the newer parts of the tree. A few minor adjustments eliminated 3/4ths of the warnings so we're moving on for now.
Regards,
John
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
- References:
- gcc 4.3 warnings
- From: Skunk Worx
- Re: gcc 4.3 warnings
- From: Matthew Saltzman
- Re: gcc 4.3 warnings
- From: Skunk Worx
- Re: gcc 4.3 warnings
- From: Matthew Saltzman
- gcc 4.3 warnings
- Prev by Date: Re: F9 updates
- Next by Date: Re: sound
- Previous by thread: Re: gcc 4.3 warnings
- Next by thread: looking for a list of the kickstart kernel boot options ?
- Index(es):
Relevant Pages
|