tech-userlevel archive

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

Re: must use gcc builtin?



>> The code is from 2006, hardly ancient.  Its library manipulates a
>> va_list as pointer using assignment and subtraction.

Then the code is broken, at least if it makes any pretenses to
portability.

Recency is no guarantee of non-brokenness.  Indeed, I suspect that (at
least within a decade or so) recency correlats _positively_ with
brokenness, because the more recent code hasn't been subjected to as
much bad-code attrition as older code.

>> I'd like a knob to compile idiomatic C, especially *good* idiomatic
>> C.

> In my world, code that invokes undefined behaviour is not good
> idiomatic C.

"What he said."  The code sketched is well within the realm where I
believe making it explode at compile time is a good thing, because it
is buggy and rendering it _obviously_ broken is a service, not a
problem.

The only way that code isn't broken is if it's not supposed to be
portable beyond a very few implementations, in which case the problem
is that you're trying to use it outside those few implementations.

/~\ 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