autoconf
[Top][All Lists]
Advanced

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

Re: How can Autoconf help with the transition to stricter compilation de


From: Paul Eggert
Subject: Re: How can Autoconf help with the transition to stricter compilation defaults?
Date: Wed, 16 Nov 2022 10:17:18 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 2022-11-16 06:26, Michael Matz wrote:
char foobar(void);
int main(void) {
   return &foobar != 0;
}

That still has undefined behavior according to draft C23, which says behavior is undefined when foobar is (say) 'memset_explicit' because the declaration 'char memset_explicit(void);' disagrees with draft C23's declaration of 'memset_explicit'. It doesn't matter whether there's a call to 'memset_explicit'. See draft C23 ยง6.2.7, which says "All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined."

If Clang's threatened pickiness were of some real use elsewhere, it might be justifiable for default Clang to break Autoconf. But so far we haven't seen real-world uses that would justify this pickiness for Autoconf's use of 'char memset_explicit(void);'.




reply via email to

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