Re: [PATCH] C/C++: more stdlib header hints (PR c/81404) (v5)

2017-11-17 Thread Jason Merrill
On Fri, Nov 3, 2017 at 2:15 PM, David Malcolm wrote: > += get_cp_stdlib_header_for_name (IDENTIFIER_POINTER (name)); > + new suggest_missing_header (loc, > + IDENTIFIER_POINTER (name), Maybe add overloads that take identifie

Re: [PATCH] C/C++: more stdlib header hints (PR c/81404) (v5)

2017-11-16 Thread Joseph Myers
On Fri, 3 Nov 2017, David Malcolm wrote: > This currently just works by scanning a hardcoded array of known > name/header associations, but perhaps in the future could be turned > into some kind of symbol database so that the compiler could record API > uses and use that to offer suggestions e.g.

[PATCH] C/C++: more stdlib header hints (PR c/81404) (v5)

2017-11-03 Thread David Malcolm
On Fri, 2017-11-03 at 17:49 +, Joseph Myers wrote: > On Thu, 2 Nov 2017, David Malcolm wrote: > > > +{"offsetof", {"", ""} }, > > offsetof is in stddef.h for C, not stdalign.h. Thanks. Here's an updated version of the patch which fixes that. OK for trunk? (assuming bootstrap and regrte

Re: [PATCH] C/C++: more stdlib header hints (PR c/81404) (v4)

2017-11-03 Thread Joseph Myers
On Thu, 2 Nov 2017, David Malcolm wrote: > +{"offsetof", {"", ""} }, offsetof is in stddef.h for C, not stdalign.h. -- Joseph S. Myers jos...@codesourcery.com

[PATCH] C/C++: more stdlib header hints (PR c/81404) (v4)

2017-11-02 Thread David Malcolm
Here's an updated version of the patch. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. OK for trunk? Changed in v4: - updated for changes of "inform_at_rich_loc" to "inform" - added #define INCLUDE_UNIQUE_PTR to known-headers.cc Changed in v3: - fixed WINT_MAX and WINT_MIN Chang

Re: [PATCH] C/C++: more stdlib header hints (PR c/81404)

2017-10-17 Thread Martin Sebor
On 10/17/2017 11:33 AM, David Malcolm wrote: This patch depends on: * "[PATCH] c-family: add name_hint/deferred_diagnostic (v2)" * https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01021.html (waiting review) * [PATCH 3/3] C: hints for missing stdlib includes for macros and types * https://gc

Re: [PATCH] C/C++: more stdlib header hints (PR c/81404)

2017-10-17 Thread Joseph Myers
On Tue, 17 Oct 2017, David Malcolm wrote: > It also adds generalizes some of the code for this (and for the "std::" > namespace hints in the C++ frontend), moving it to a new > c-family/known-headers.cc and .h, and introducing a class known_headers. > This currently just works by scanning a hardco

[PATCH] C/C++: more stdlib header hints (PR c/81404)

2017-10-17 Thread David Malcolm
This patch depends on: * "[PATCH] c-family: add name_hint/deferred_diagnostic (v2)" * https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01021.html (waiting review) * [PATCH 3/3] C: hints for missing stdlib includes for macros and types * https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00125.html