Scott Robert Ladd wrote:
> Robert Dewar wrote:
>> Seems a weak argument to me. Changing gcc would create incompatibilities
>> with previous behavior of gcc, and that is FAR more significant than
>> worrying about other compilers in my opinion. Having gcc compile
>> non-portable code accepted by other compilers is a useful goal, but
>> one of low priority compared to maintaining compatibility as far as
>> possible between gcc versions.
>
> Wouldn't it be possible to implement a compile-time option to enable the
> desired behavior only for those poor folk who have this problem?
Yes, absolutely so. Just add a flag in the usual way, test for it in
cpplex.c/skip_escaped_newlines, and change the bit that says
if (saved_cur != buffer->cur - 1
&& !pfile->state.lexing_comment)
cpp_error (pfile, DL_WARNING,
"backslash and newline separated by space");
so that according to the flag setting, it could either issue a DL_WARNING as
it currently does, or the level could be changed to DL_PEDWARN or DL_ERROR, or
it could skip the cpp_error call altogether.
Generating the actual patch is left as an exercise for the reader[*]!
cheers,
DaveK
[*] Or whoever else actually _cares_ about this more than I do!
--
Can't think of a witty .sigline today....