[patch] Let stddef.h redefine NULL if __need_NULL is set

Richard Smith richard at metafoo.co.uk
Tue Apr 29 17:40:48 PDT 2014


On Mon, Apr 28, 2014 at 7:52 PM, Nico Weber <thakis at chromium.org> wrote:

> >> Let me know which one of the 3 patches (with 1 being the one I
> >> originally sent) you like best. If it's 3, I'll add a few more tests
> >> for that.
> >
> >
> > I strongly prefer patch 3 over 2. (With just patch 2, I worry that some
> libc
> > header would say "give me NULL and FOO", and just get NULL.)
> >
> > Instead of repeating an 'ifdef _STDDEF_H_imp' test, could you define all
> the
> > __need_* macros in the _STDDEF_H_imp section? I'd find that slightly
> easier
> > to reason about.
>
> Done. Also added a test, and fixed bugs found by the test.
>

Please add a comment to the block where you #define __need_* saying we
deliberately don't define __need_wint_t.

Other than that, the patch LGTM (though we'll need more changes here to
make this work properly in the presence of modules).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140429/e2f9b236/attachment.html>


More information about the cfe-commits mailing list