This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: The treatment of null characters in C source files




Zack Weinberg wrote:

> >   The only other place that I know of with relevent verbiage is
> > section 2.4 - Preprocessing Tokens where it lists the various kinds
> > of preprocessing tokens and then says that "any other non whitespace
> > character that can not be one of the above" is a separate
> > preprocessing token. This allows one to use all kinds of random
> > characters in macro definitions, or on #error directives (for
> > example). Of course such uses are somewhat obscure, but nontheless
> > are legal (one would have to use the stringizing operator to make
> > use of such a macro, for example).
> >
> >
>
> This is not _required_ by the standard any more than we are required
> to do something sensible with @ outside of strings.

The following code must compile cleanly......  #define AT @  #define STR(s) #s
  #define XSTR(s) STR(s)
  char *at = XSTR(AT);

also,

  #error brolley@cygnus.com

Must be accepted.

I'm not arguing in favour of jumping through hoops to handle nul, I'm just giving
examples of where other characters which are not in the basic source character
set must be handled cleanly (i.e. we are _required_ to handle them).

Dave


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]