Path: csiph.com!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Is C ready to become a safer language? Date: Sat, 10 Feb 2024 16:15:08 -0800 Organization: None to speak of Lines: 26 Message-ID: <877cjbdfg3.fsf@nosuchdomain.example.com> References: <87jznfh7p6.fsf@nosuchdomain.example.com> <865xyw62av.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="a3ea5551d1916ca86f611a52355c117b"; logging-data="106934"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IGRPt/lZo29IuXE+ajDh1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:qNCu9EfiV9scmrPLLCwCOc11FF0= sha1:4C3QhzlVVwA1fcEQehQbjGGMv/0= Xref: csiph.com comp.lang.c:382293 Tim Rentsch writes: [snip discussion of a program that divides by zero] > An implementation can refuse to translate the program, but not > because undefined behavior occurs. The undefined behavior here > happens only when the program is executed, but just compiling the > program doesn't do that. No execution, no undefined behavior. > Still the program may be rejected, because it is not strictly > conforming (by virtue of having output depend on the undefined > behavior if the program is ever run). Just to be clear, would you say that a conforming hosted implementation may reject this program: #include #include int main(void) { printf("INT_MAX = %d\n", INT_MAX); } solely because it's not strictly conforming? -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Medtronic void Void(void) { Void(); } /* The recursive call of the void */