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]
Other format: [Raw text]

Re: pointers are not permitted as case values


>         switch (*pat)
>         {
>             case NULL:  // pattern at end
>                 return (!*str); // String at end ?

I'm suprised with three responses, everyone has correctly diagnosed
the fix, but noone has spotted it as a spelling error.

NUL == '\0' was meant, and NULL is strictly wrong here, even though it
may work on some compilers.  See the C FAQ for a complete description
of the issue.


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