Bug 34516

Summary: trivial sentinels
Product: gcc Reporter: Mike Stump <mikestump>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: UNCONFIRMED ---    
Severity: enhancement CC: egallager, gcc-bugs, mikestump, pinskia, steven
Priority: P3    
Version: 4.2.1   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Mike Stump 2007-12-17 21:59:40 UTC
Please implement http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01047.html

This is useful because previously, gcc-4.0.1 didn't warn about this case:

void f(void *last, ...) __attribute__((sentinel(0,1)));

main() {
  f((void*)0);
}

but gcc-4.2 does.  We have APIs that make use of the null being in the first argument and they used the sentinel check, but now clients get lots of warnings due to the `new' behavior.

We've added this to our compiler, just 49 lines...

radr://5631180
Comment 1 Andrew Pinski 2007-12-17 22:27:39 UTC
And why don't you submit it????
Comment 2 Steven Bosscher 2007-12-17 22:30:18 UTC
If you have added it to (*cough*) "your compiler", why don't you just submit it?

Oh wait.  Apple. Right...
Comment 3 Eric Gallager 2018-03-08 03:14:05 UTC
(In reply to Andrew Pinski from comment #1)
> And why don't you submit it????

I'm assuming it has something to do with this bug being filed around the time of the GPL3 transition...