[LLVMdev] optimization assumes malloc return is non-null

Jonathan S. Shapiro shap at eros-os.com
Wed May 14 12:06:34 PDT 2008


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




More information about the llvm-dev mailing list