Sujet : Re: question about linker
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 05. Dec 2024, 04:42:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86ikrylrrf.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Michael S <
already5chosen@yahoo.com> writes:
[on adding a rule to the C standard so functions defined
with a prototype anywhere in a file cause those functions'
types available throughout the same file]
No, I am afraid of cases where function is used without prototype and
then there is conflicting definition later in the module.
Of course, it's UB, but in practice it could often work fine.
Something like that:
>
static int bar();
int foo(void)
{
return bar(42);
}
>
static int bar(int a, int b)
{
if (a == 42)
return -1;
return a - b;
}
As history-breaking changes go, this one seems about as
benign as one could hope. Clearly a win IMO.