Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: How does gcc (any compiler) actually convert a function call, say atoi(), into assembly/machine code? Date: Tue, 03 Jan 2017 13:08:40 -0800 Organization: None to speak of Lines: 20 Message-ID: References: <06544819-1f87-4e1c-94ca-918f049d1d42@googlegroups.com> <5bf5dcb7-ef8c-4d6b-aa1b-11f0522651b7@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="f1ffbb62f7d4ea154aec5923c7307730"; logging-data="9414"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RjxxIYJs9ylB+SpbvB3Xp" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:TTyQ8Jvxe7zatc0NToFfs5c+SrY= sha1:cxwCMW7xyJnOOZKifhaZHsw6Rcc= Xref: csiph.com comp.lang.c:101035 supercat@casperkitty.com writes: [...] > In any case, I forgot to mention that many POSIX implementations deviate > from the Standard in a much more important way: the Standard does not > recognize the possibility that malloc(), calloc(), etc. may return a > pointer which isn't null, but which might nonetheless cause a program to > die if/when code tries to actually use it. That has nothing to do with POSIX. The POSIX requirements for malloc() are, as far as I can tell, exactly the same as the ISO C requirements (including the implementation-defined behavior of malloc(0)). What you're describing is a characteristic of the Linux kernel. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"