aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2017-09-15 17:11:47 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-09-15 17:11:47 +0000
commit4a8ca690b0b73f4e0bae542fd69a1ee0d9e73126 (patch)
treef5d02f2b4122c66d96510962c0ed533abe820c2d /gcc/c-family
parentf5e37f2ae57a87f8e661967f431e4bed37aceb2d (diff)
downloadgcc-4a8ca690b0b73f4e0bae542fd69a1ee0d9e73126.zip
gcc-4a8ca690b0b73f4e0bae542fd69a1ee0d9e73126.tar.gz
gcc-4a8ca690b0b73f4e0bae542fd69a1ee0d9e73126.tar.bz2
c-pragma.c (handle_pragma_scalar_storage_order): Expand on error message for non-uniform endianness and issue a warning in C++.
* c-pragma.c (handle_pragma_scalar_storage_order): Expand on error message for non-uniform endianness and issue a warning in C++. From-SVN: r252831
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-pragma.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 4fffa31..a3f990d 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-pragma.c (handle_pragma_scalar_storage_order): Expand on error
+ message for non-uniform endianness and issue a warning in C++.
+
2017-09-15 Jakub Jelinek <jakub@redhat.com>
* c.opt (Wc++1z-compat): Change from option to undocumented alias.
diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c
index a2ffdba..f7b59b3 100644
--- a/gcc/c-family/c-pragma.c
+++ b/gcc/c-family/c-pragma.c
@@ -415,7 +415,19 @@ handle_pragma_scalar_storage_order (cpp_reader *ARG_UNUSED(dummy))
tree x;
if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN)
- error ("scalar_storage_order is not supported");
+ {
+ error ("scalar_storage_order is not supported because endianness "
+ "is not uniform");
+ return;
+ }
+
+ if (c_dialect_cxx ())
+ {
+ if (warn_unknown_pragmas > in_system_header_at (input_location))
+ warning (OPT_Wunknown_pragmas,
+ "%<#pragma scalar_storage_order%> is not supported for C++");
+ return;
+ }
token = pragma_lex (&x);
if (token != CPP_NAME)