tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Do all -current compilers support C23 typed enum syntax?
> The compiler, being very clever, sees that all enumerated values of
> enum cmd have been covered by the switch, so it helpfully deletes
> some code it can _prove_ is dead -- this part:
> default:
> panic("unknown command");
Such a compiler is broken, and I would not hesitate to file a bug
report against it, if only because nothing prevents recv_cmd from
returning a cmd whose .name contains a value other than one of the enum
constants, meaning that code is *not* dead.
More generally, compilers exist to serve their users, not to
straitjacket them. If the coder has to work around the compiler, the
compiler is broken, regardless of what specs it might conform to.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse%rodents-montreal.org@localhost
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
Home |
Main Index |
Thread Index |
Old Index