[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] C99 static array indices in function args

From: Michael Matz
Subject: Re: [Tinycc-devel] C99 static array indices in function args
Date: Sun, 31 Dec 2017 17:21:50 +0100 (CET)
User-agent: Alpine 2.20 (LSU 67 2015-01-07)


On Tue, 26 Dec 2017, Michael B. Smith wrote:

No. Warnings are never required diagnostics (and even if, what specifically would you want to warn about in this case?). The only require diagnostics are from constraint violations. Most other undefined behaviours don't need to be diagnosed (of course, if easily doable it's nice to diagnose them).

Here we disagree.

I was arguing from the point of standard conformance, just in case this wasn't clear. I thought you did the same, but now I think you're arguing from a quality of implementation perspective. If so I agree with you, such kinds of warnings are nice to have. As often the case, though, you need to find the sweet spot between difficulty of implementing them and returned value of the warnings.

As this construct is nearly never used in the real world the value of such warning wouldn't be very large. Implementing it to the fullest extent possible (i.e. for calls to functions in the same unit) entails storing the necessary meta-info, and hence comes at a non-trivial cost. Personally I don't think it's worth it.

More worth would be IMHO a mode where TCC doesn't stop after the first error and instead tries to recover. Has its own set of problems but would make tcc more like other C compilers.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]