misc.c: line 65: #warning using trap_unaligned

Bob Proulx bob at proulx.com
Thu Jun 20 19:07:01 CEST 2002

> > > gnupg-1.0.7 includes in misc.c: line 65: the following:
> > > #warning using trap_unaligned
> > 
> > Huh, you are not using gcc:
> > 
> > #if defined(__linux__) && defined(__alpha__) && __GLIBC__ < 2
> > #warning using trap_unaligned
> Why don't you:
>   #ifdef __GNUC__
>   #warning using trap_unaligned

I think there is a misunderstanding.  The cpp phase needs to read and
parse all lines #something because that #something might just be #else
or #endif.  It would be looking for the matching endif or else.  When
it gets to a line #warning it does not know what to do with that and
prints a warning about an unknown preprocessor directive.

This is not a compiler phase warning but a preprocessor phase warning.
The compiler and cpp might be combined but they need to behave as if
they are not.  But you can't use the preprocessor to hide this from
the preprocessor!  :-) Just to be clear you can use the preprocessor
to hide code from the compiler, and I think that has been the two
previous suggestions, but of course that does not work for the
preprocessor itself.

And it is only a warning so I note this only as noise added to the
build and not in any way critical.  It is however not quite perfect
code and therefore could still stand improvement.  I myself am in the
camp that there really are no warnings.  I would either make it a hard
error or remove it entirely.  But that is just one opinion.  For the
archive here is the compile trace.

  rwp at strife:~/gnupg-1.0.7/g10: rm misc.o
  rwp at strife:~/gnupg-1.0.7/g10: make misc.o
  source='misc.c' object='misc.o' libtool=no \
  depfile='.deps/misc.Po' tmpdepfile='.deps/misc.TPo' \
  depmode=hp /bin/sh ../scripts/depcomp \
  cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -I../intl    -O
  +DA1.1 +DS2.0 -Ae -D_HPUX_SOURCE -c `test -f misc.c || echo './'`misc.c
  cpp: "misc.c", line 62: warning 2013: Unknown preprocessing directive.

The 'cc' being used is the HP ANSI C compiler on HP-UX 10.20.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : /pipermail/attachments/20020620/7d668fd8/attachment.bin

More information about the Gnupg-devel mailing list