Hi Eric. On Thu, 27 Aug 2009, Eric Blake wrote:
> Joel E. Denny <jdenny <at> clemson.edu> writes: > > > char const *p = yytext + 1; > > - if (*p == ' ') > > - p = "` '"; > > + char quoted_ws[] = "` '"; > > + if (isspace (*p) && isprint (*p)) > > Oops. Non-portable code, since an 8-bit signed char falls outside of the > valid > domain of is* (cygwin's headers catch this bug, and I have a pending bug > request asking glibc to warn in this case, too): > > scan-gram.l: In function `gram_lex': > scan-gram.l:621: warning: subscript has type `char' > scan-gram.l:621: warning: subscript has type `char' > > OK to apply this fix? Thanks for catching the problem. However, I'm a little confused. My isspace man page says the argument is of type int. It also says: These functions check whether c, which must have the value of an unsigned char or EOF, falls into a certain character class according to the current locale. Isn't EOF usually -1? What type includes -1 and doesn't include signed char? > From: Eric Blake <[email protected]> > Date: Thu, 27 Aug 2009 10:56:53 -0600 > Subject: [PATCH] scan-gram: avoid portability trap with ctype usage. > > * src/scan-gram.l (splice): Avoid compiler warning. I would say the correct top-level construct is <SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER> rather than splice. git doesn't know how to read Flex specifications.
