This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: pointers are not permitted as case values
- From: Tim Hollebeek <tim at hollebeek dot com>
- To: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 2 Oct 2002 09:15:46 -0700
- Subject: Re: pointers are not permitted as case values
- References: <200210021541.LAA13107@bromo.msbb.uc.edu>
- Reply-to: tim at hollebeek dot com
> 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.