Closed brooksdavis closed 7 years ago
This is probably quite difficult to fix. The integer constant expression code has a few ugly cases for handling intptr_t
, but making it to work with pointers is probably going to require some invasive changes. We'll need to track the fact that the pointer is a cast from an integer, which I think the existing infrastructure doesn't know how to handle.
There's a lovely bit of code in ntp split between
contrib/ntp/sntp/libopts/enum.c
andcontrib/ntp/sntp/libopts/autoopts/options.h
which usesenum
s (thoughint
s have the same issue) cast to pointers and then touintptr_t
in aswitch
statement. It fails to compile with an error like:The sample code is:
If recast as an if, else if, else, chain the compiler is able to handle this. I'm not sure that it's sensible to make this code work.