Jonathan S. Shapiro
2008-May-14 14:46 UTC
[LLVMdev] optimization assumes malloc return is non-null
On Wed, 2008-05-14 at 23:23 +0900, Neil Booth wrote:> Jonathan S. Shapiro wrote:- > > Is there a requirement somewhere in the C *Language* Specification that > > ties all of this together in the required way? > > Reserved identifiers and header inclusion. > > Neil.What section of the C standard do I need to refresh myself on here?
David Vandevoorde
2008-May-14 17:26 UTC
[LLVMdev] optimization assumes malloc return is non-null
On May 14, 2008, at 10:46 AM, Jonathan S. Shapiro wrote:> On Wed, 2008-05-14 at 23:23 +0900, Neil Booth wrote: >> Jonathan S. Shapiro wrote:- >>> Is there a requirement somewhere in the C *Language* Specification >>> that >>> ties all of this together in the required way? >> >> Reserved identifiers and header inclusion. >> >> Neil. > > What section of the C standard do I need to refresh myself on here? >Good question (referring to the original question). The answer appears to be 7.1.3/1, fourth bullet: "All identifiers with external linkage in any of the following subclauses (including the future library directions) are always reserved for use as identifiers with external linkage." Daveed
Jonathan S. Shapiro
2008-May-14 19:06 UTC
[LLVMdev] optimization assumes malloc return is non-null
On Wed, 2008-05-14 at 13:26 -0400, David Vandevoorde wrote:> On May 14, 2008, at 10:46 AM, Jonathan S. Shapiro wrote: > > On Wed, 2008-05-14 at 23:23 +0900, Neil Booth wrote: > >> Jonathan S. Shapiro wrote:- > >>> Is there a requirement somewhere in the C *Language* Specification > >>> that > >>> ties all of this together in the required way? > > Good question (referring to the original question). The answer > appears to be 7.1.3/1, fourth bullet: > > "All identifiers with external linkage in any of the following > subclauses (including the future library directions) are always > reserved for use as identifiers with external linkage."First, thank you. I apologize if I have been acting like a language lawyer, but I'm about to be working on static analysis tools and I'm discovering that my understanding of the language was, ahem, incomplete. Which seems like a bad situation for a static analysis tool author to be in. :-) I read 7.1.3 merely to state that the library-reserved identifiers must always have external linkage, not that they are required to be bound to the library implementations. That is: a program is free to override them. Am I misunderstanding the use of the term "reserved" in this clause? Should I be reading this as "are always reserved, and further must always have external linkage" (which seems to be your reading)? Also: 1 Can you suggest anything in addition to the rationale documents that I should go read? 2 Since these questions aren't really specific to LLVM, do you know of a more appropriate place where I might ask them? Thanks again. shap
Reasonably Related Threads
- [LLVMdev] optimization assumes malloc return is non-null
- [LLVMdev] optimization assumes malloc return is non-null
- [LLVMdev] optimization assumes malloc return is non-null
- [LLVMdev] optimization assumes malloc return is non-null
- [LLVMdev] optimization assumes malloc return is non-null