tech-userlevel archive

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

Re: alloca again



Am 03.10.2022 um 14:31 schrieb nia:
This is the current alloca definition in the libc headers:

#if defined(_NETBSD_SOURCE)
#if defined(alloca) && (alloca == __builtin_alloca) && \

According to my knowledge of the C preprocessor, the condition 'alloca
== __builtin_alloca' always evaluates to '0 == 0', assuming that if
'alloca' and '__builtin_alloca' are actually defined, they expand to
some other identifier. As C90 6.8.1 and C99 6.10.1p4 both say, "all
remaining identifiers are replaced with the pp-number 0."

Did this condition make any sense at any time in the last 40 years? If
not, why has this piece of clearly broken code survived since 1993-03-25?

Roland



Home | Main Index | Thread Index | Old Index