This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61534] Wlogical-op should not warn when either operand comes from macro expansion
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Jun 2014 17:53:35 +0000
- Subject: [Bug c/61534] Wlogical-op should not warn when either operand comes from macro expansion
- Auto-submitted: auto-generated
- References: <bug-61534-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61534
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-06-25
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This should be easy with track macro expansion on, we'd just have
--- a/gcc/input.h
+++ b/gcc/input.h
@@ -60,6 +60,8 @@ extern location_t input_location;
#define in_system_header_at(LOC) \
((linemap_location_in_system_header_p (line_table, LOC)))
+#define from_macro_expansion_at(LOC) \
+ ((linemap_location_from_macro_expansion_p (line_table, LOC)))
void dump_line_table_statistics (void);
and then we could use from_macro_expansion_at and don't warn if it's true. But
the problem is with -ftrack-macro-expansion=0, since from_macro_expansion_at
wouldn't work :(.