[cfe-dev] Disable #error?

Sean Silva silvas at purdue.edu
Wed Jan 15 09:39:14 PST 2014


On Wed, Jan 15, 2014 at 2:48 AM, Jacob Carlborg <doob at me.com> wrote:

> On 2014-01-14 23:14, Kim Gräsman wrote:
>
>  That's one way of looking at it.
>>
>> But we're not really compiling (maybe Jacob is, in some sense); we're
>> doing static analysis and the #error directives could give us useful
>> data for analysis instead of just aborting.
>>
>
> I'm doing source to source translation. I don't know if you consider that
> compiling. It doesn't generate any object or exectuable code.


You are trying to understand the meaning of the program, which means that
you are under the same correctness constraints as when compiling. Consider:

#if defined(FOO)
#error "bar"
void
#else
int
#endif
some_function(int arg);

If you ignore the #error, you will misunderstand the program's semantics.

-- Sean Silva


>
>
>  Regex was actually my next plan of attack, we'll see if I ever get
>> around to it :-)
>>
>
> I would prefer to avoid that.
>
>
> --
> /Jacob Carlborg
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140115/d123e3e3/attachment.html>


More information about the cfe-dev mailing list