summaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
diff options
context:
space:
mode:
authoraustern <austern@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-19 19:19:46 +0000
committeraustern <austern@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-19 19:19:46 +0000
commita861d8cab4bd23af720dc431ea1d0271212d4893 (patch)
treedb823fd432e76eee10d350bcaede94deebaa3066 /gcc/c-opts.c
parent57c7298c80d7bf22d1f1bc24f13d24983041e9b5 (diff)
downloadgcc-a861d8cab4bd23af720dc431ea1d0271212d4893.tar.gz
Add a new flag, -W(no-)invalid-offsetof, to control whether or
not the compiler warns about incorrect use of the offsetof macro in C++. By default the warning is on. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66972 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r--gcc/c-opts.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index e2722b37f74..49189c4d289 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -203,6 +203,7 @@ static void finish_options PARAMS ((void));
OPT("Wimplicit-function-declaration", CL_C, OPT_Wimplicit_function_decl) \
OPT("Wimplicit-int", CL_C, OPT_Wimplicit_int) \
OPT("Wimport", CL_ALL, OPT_Wimport) \
+ OPT("Winvalid-offsetof", CL_CXX, OPT_Winvalid_offsetof) \
OPT("Winvalid-pch", CL_ALL, OPT_Winvalid_pch) \
OPT("Wlong-long", CL_ALL, OPT_Wlong_long) \
OPT("Wmain", CL_C, OPT_Wmain) \
@@ -942,6 +943,10 @@ c_common_decode_option (argc, argv)
cpp_opts->warn_import = on;
break;
+ case OPT_Winvalid_offsetof:
+ warn_invalid_offsetof = on;
+ break;
+
case OPT_Winvalid_pch:
cpp_opts->warn_invalid_pch = on;
break;