PING: [PATCH] Improve message 'Undefined allocation of 0 bytes'

Jordan Rose jordan_rose at apple.com
Tue Apr 22 14:46:45 PDT 2014


Hi, Daniel. Sorry for not replying sooner -- I was on vacation.

I agree that this should be changed, but I'm not sure the new phrasing is strong enough. We're not actually checking what the behavior of a 0-byte allocation is on the user's target platform, so it's possible the use is unsafe now, not just when they try to port it to another target. How about "allocation of 0 bytes has unspecified behavior"? It's a bit more wordy, but it also sounds more like something to pay attention to.

(I thought about "implementation-defined behavior" as well, but I'm not sure that's strong enough either...people might just assume they know how their own implementation works. Then again, it is documented for many platforms.)

What do you think?
Jordan


On Apr 20, 2014, at 4:46 , Daniel Marjamäki <Daniel.Marjamaki at evidente.se> wrote:

> 
> Hello!
> 
> Here is a fix for:
> http://llvm.org/bugs/show_bug.cgi?id=15708
> 
> The message 'Undefined allocation of 0 bytes' is not entirely correct. The behaviour is implementation defined.
> 
> Best regards,
> Daniel Marjamäki
> 
> ..................................................................................................................
> Daniel Marjamäki Senior Engineer
> Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden
> 
> Mobile:                 +46 (0)709 12 42 62
> E-mail:                 Daniel.Marjamaki at evidente.se
> 
> www.evidente.se
> <15708.diff>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140422/59fe837d/attachment.html>


More information about the cfe-commits mailing list