[OpenAFS-devel] problem with cpp directives in concatenation...

Jeffrey Hutzelman jhutz@cmu.edu
Wed, 13 Jun 2001 22:29:23 -0400 (EDT)


On Wed, 13 Jun 2001, Neulinger, Nathan wrote:

> Just started testing with gcc-3.0 snapshot for some of the sources I'm
> working on, and noticed that it doesn't like this:
> 
>                 printf ("Usage: ptserver [-database <db path>] "
> #ifndef AFS_NT40_ENV
>                         "[-syslog[=FACILITY]] "
> #endif
>                         "[-p <number of processes>] [-rebuild] "
> 
> 
> gives this error:
> 
> ptserver.c:161:1: directives may not be used inside a macro argument
> ptserver.c:161:1: unterminated argument list invoking macro "printf"
> ptserver.c:162: parse error before string constant
> 
> so, all those are going to need changed.
> 
> What's really bizarre is - since when was printf a macro?

It sounds to me like gcc and/or glibc is going to have to change.  I'm
sure we're not the only ones doing this sort of thing.

-- Jeffrey T. Hutzelman (N3NHS) <jhutz+@cmu.edu>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA