]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/c-family/c-pragma.c
Wrap option names in gcc internal messages with %< and %>.
[thirdparty/gcc.git] / gcc / c-family / c-pragma.c
index a2ffdbacbbbb6916d791b82bec84980c048da20d..fbc734a047bdc4216b6170e2394a65612b3c0077 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle #pragma, system V.4 style.  Supports #pragma weak and #pragma pack.
-   Copyright (C) 1992-2017 Free Software Foundation, Inc.
+   Copyright (C) 1992-2019 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -196,7 +196,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
     warning (OPT_Wpragmas, "junk at end of %<#pragma pack%>");
 
   if (flag_pack_struct)
-    GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
+    GCC_BAD ("#pragma pack has no effect with %<-fpack-struct%> - ignored");
 
   if (action != pop)
     switch (align)
@@ -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)
@@ -1274,9 +1286,11 @@ static const struct omp_pragma_def omp_pragmas[] = {
   { "cancel", PRAGMA_OMP_CANCEL },
   { "cancellation", PRAGMA_OMP_CANCELLATION_POINT },
   { "critical", PRAGMA_OMP_CRITICAL },
+  { "depobj", PRAGMA_OMP_DEPOBJ },
   { "end", PRAGMA_OMP_END_DECLARE_TARGET },
   { "flush", PRAGMA_OMP_FLUSH },
   { "master", PRAGMA_OMP_MASTER },
+  { "requires", PRAGMA_OMP_REQUIRES },
   { "section", PRAGMA_OMP_SECTION },
   { "sections", PRAGMA_OMP_SECTIONS },
   { "single", PRAGMA_OMP_SINGLE },
@@ -1331,20 +1345,6 @@ c_pp_lookup_pragma (unsigned int id, const char **space, const char **name)
        return;
       }
 
-  if (id == PRAGMA_CILK_SIMD)
-    {
-      *space = NULL;
-      *name = "simd";
-      return;
-    }
-
-  if (id == PRAGMA_CILK_GRAINSIZE)
-    {
-      *space = "cilk";
-      *name = "grainsize";
-      return;
-    }
-
   if (id >= PRAGMA_FIRST_EXTERNAL
       && (id < PRAGMA_FIRST_EXTERNAL + registered_pp_pragmas.length ()))
     {
@@ -1520,10 +1520,6 @@ init_pragma (void)
                                      omp_pragmas_simd[i].id, true, true);
     }
 
-  if (flag_cilkplus)
-    cpp_register_deferred_pragma (parse_in, NULL, "simd", PRAGMA_CILK_SIMD,
-                                 true, false);
-
   if (!flag_preprocess_only)
     cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess",
                                  PRAGMA_GCC_PCH_PREPROCESS, false, false);
@@ -1532,9 +1528,9 @@ init_pragma (void)
     cpp_register_deferred_pragma (parse_in, "GCC", "ivdep", PRAGMA_IVDEP, false,
                                  false);
 
-  if (flag_cilkplus)
-    cpp_register_deferred_pragma (parse_in, "cilk", "grainsize",
-                                 PRAGMA_CILK_GRAINSIZE, true, false);
+  if (!flag_preprocess_only)
+    cpp_register_deferred_pragma (parse_in, "GCC", "unroll", PRAGMA_UNROLL,
+                                 false, false);
 
 #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
   c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);