OSDN Git Service

* gcc.dg/setjmp-2.c: Only run in 32-bit.
[pf3gnuchains/gcc-fork.git] / gcc / c-pragma.c
1 /* Handle #pragma, system V.4 style.  Supports #pragma weak and #pragma pack.
2    Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
3    Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.  */
21
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
26 #include "rtl.h"
27 #include "tree.h"
28 #include "function.h"
29 #include "cpplib.h"
30 #include "c-pragma.h"
31 #include "flags.h"
32 #include "toplev.h"
33 #include "ggc.h"
34 #include "c-common.h"
35 #include "output.h"
36 #include "tm_p.h"
37 #include "target.h"
38
39 #define GCC_BAD(msgid) do { warning (0, msgid); return; } while (0)
40 #define GCC_BAD2(msgid, arg) do { warning (0, msgid, arg); return; } while (0)
41
42 typedef struct align_stack GTY(())
43 {
44   int                  alignment;
45   tree                 id;
46   struct align_stack * prev;
47 } align_stack;
48
49 static GTY(()) struct align_stack * alignment_stack;
50
51 #ifdef HANDLE_PRAGMA_PACK
52 static void handle_pragma_pack (cpp_reader *);
53
54 #ifdef HANDLE_PRAGMA_PACK_PUSH_POP
55 /* If we have a "global" #pragma pack(<n>) in effect when the first
56    #pragma pack(push,<n>) is encountered, this stores the value of 
57    maximum_field_alignment in effect.  When the final pop_alignment() 
58    happens, we restore the value to this, not to a value of 0 for
59    maximum_field_alignment.  Value is in bits.  */
60 static int default_alignment;
61 #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = *(alignment_stack == NULL \
62         ? &default_alignment \
63         : &alignment_stack->alignment) = (ALIGN))
64
65 static void push_alignment (int, tree);
66 static void pop_alignment (tree);
67
68 /* Push an alignment value onto the stack.  */
69 static void
70 push_alignment (int alignment, tree id)
71 {
72   align_stack * entry;
73
74   entry = ggc_alloc (sizeof (* entry));
75
76   entry->alignment  = alignment;
77   entry->id         = id;
78   entry->prev       = alignment_stack;
79        
80   /* The current value of maximum_field_alignment is not necessarily 
81      0 since there may be a #pragma pack(<n>) in effect; remember it 
82      so that we can restore it after the final #pragma pop().  */
83   if (alignment_stack == NULL)
84     default_alignment = maximum_field_alignment;
85  
86   alignment_stack = entry;
87
88   maximum_field_alignment = alignment;
89 }
90
91 /* Undo a push of an alignment onto the stack.  */
92 static void
93 pop_alignment (tree id)
94 {
95   align_stack * entry;
96       
97   if (alignment_stack == NULL)
98     GCC_BAD ("#pragma pack (pop) encountered without matching #pragma pack (push)");
99
100   /* If we got an identifier, strip away everything above the target
101      entry so that the next step will restore the state just below it.  */
102   if (id)
103     {
104       for (entry = alignment_stack; entry; entry = entry->prev)
105         if (entry->id == id)
106           {
107             alignment_stack = entry;
108             break;
109           }
110       if (entry == NULL)
111         warning (0, "\
112 #pragma pack(pop, %s) encountered without matching #pragma pack(push, %s)"
113                  , IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id));
114     }
115
116   entry = alignment_stack->prev;
117
118   maximum_field_alignment = entry ? entry->alignment : default_alignment;
119
120   alignment_stack = entry;
121 }
122 #else  /* not HANDLE_PRAGMA_PACK_PUSH_POP */
123 #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN))
124 #define push_alignment(ID, N) \
125     GCC_BAD ("#pragma pack(push[, id], <n>) is not supported on this target")
126 #define pop_alignment(ID) \
127     GCC_BAD ("#pragma pack(pop[, id], <n>) is not supported on this target")
128 #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
129
130 /* #pragma pack ()
131    #pragma pack (N)
132    
133    #pragma pack (push)
134    #pragma pack (push, N)
135    #pragma pack (push, ID)
136    #pragma pack (push, ID, N)
137    #pragma pack (pop)
138    #pragma pack (pop, ID) */
139 static void
140 handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
141 {
142   tree x, id = 0;
143   int align = -1;
144   enum cpp_ttype token;
145   enum { set, push, pop } action;
146
147   if (c_lex (&x) != CPP_OPEN_PAREN)
148     GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
149
150   token = c_lex (&x);
151   if (token == CPP_CLOSE_PAREN)
152     {
153       action = set;
154       align = initial_max_fld_align;
155     }
156   else if (token == CPP_NUMBER)
157     {
158       align = TREE_INT_CST_LOW (x);
159       action = set;
160       if (c_lex (&x) != CPP_CLOSE_PAREN)
161         GCC_BAD ("malformed %<#pragma pack%> - ignored");
162     }
163   else if (token == CPP_NAME)
164     {
165 #define GCC_BAD_ACTION do { if (action != pop) \
166           GCC_BAD ("malformed %<#pragma pack(push[, id][, <n>])%> - ignored"); \
167         else \
168           GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \
169         } while (0)
170
171       const char *op = IDENTIFIER_POINTER (x);
172       if (!strcmp (op, "push"))
173         action = push;
174       else if (!strcmp (op, "pop"))
175         action = pop;
176       else
177         GCC_BAD2 ("unknown action %qs for %<#pragma pack%> - ignored", op);
178
179       while ((token = c_lex (&x)) == CPP_COMMA)
180         {
181           token = c_lex (&x);
182           if (token == CPP_NAME && id == 0)
183             {
184               id = x;
185             }
186           else if (token == CPP_NUMBER && action == push && align == -1)
187             {
188               align = TREE_INT_CST_LOW (x);
189               if (align == -1)
190                 action = set;
191             }
192           else
193             GCC_BAD_ACTION;
194         }
195
196       if (token != CPP_CLOSE_PAREN)
197         GCC_BAD_ACTION;
198 #undef GCC_BAD_ACTION
199     }
200   else
201     GCC_BAD ("malformed %<#pragma pack%> - ignored");
202
203   if (c_lex (&x) != CPP_EOF)
204     warning (0, "junk at end of %<#pragma pack%>");
205
206   if (flag_pack_struct)
207     GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
208
209   if (action != pop)
210     switch (align)
211       {
212       case 0:
213       case 1:
214       case 2:
215       case 4:
216       case 8:
217       case 16:
218         align *= BITS_PER_UNIT;
219         break;
220       case -1:
221         if (action == push)
222           {
223             align = maximum_field_alignment;
224             break;
225           }
226       default:
227         GCC_BAD2 ("alignment must be a small power of two, not %d", align);
228       }
229
230   switch (action)
231     {
232     case set:   SET_GLOBAL_ALIGNMENT (align);  break;
233     case push:  push_alignment (align, id);    break;
234     case pop:   pop_alignment (id);            break;
235     }
236 }
237 #endif  /* HANDLE_PRAGMA_PACK */
238
239 static GTY(()) tree pending_weaks;
240
241 #ifdef HANDLE_PRAGMA_WEAK
242 static void apply_pragma_weak (tree, tree);
243 static void handle_pragma_weak (cpp_reader *);
244
245 static void
246 apply_pragma_weak (tree decl, tree value)
247 {
248   if (value)
249     {
250       value = build_string (IDENTIFIER_LENGTH (value),
251                             IDENTIFIER_POINTER (value));
252       decl_attributes (&decl, build_tree_list (get_identifier ("alias"),
253                                                build_tree_list (NULL, value)),
254                        0);
255     }
256
257   if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
258       && !DECL_WEAK (decl) /* Don't complain about a redundant #pragma.  */
259       && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
260     warning (0, "%Japplying #pragma weak %qD after first use results "
261              "in unspecified behavior", decl, decl);
262
263   declare_weak (decl);
264 }
265
266 void
267 maybe_apply_pragma_weak (tree decl)
268 {
269   tree *p, t, id;
270
271   /* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed.  */
272
273   /* No weak symbols pending, take the short-cut.  */
274   if (!pending_weaks)
275     return;
276   /* If it's not visible outside this file, it doesn't matter whether
277      it's weak.  */
278   if (!DECL_EXTERNAL (decl) && !TREE_PUBLIC (decl))
279     return;
280   /* If it's not a function or a variable, it can't be weak.
281      FIXME: what kinds of things are visible outside this file but
282      aren't functions or variables?   Should this be an assert instead?  */
283   if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
284     return;
285
286   id = DECL_ASSEMBLER_NAME (decl);
287
288   for (p = &pending_weaks; (t = *p) ; p = &TREE_CHAIN (t))
289     if (id == TREE_PURPOSE (t))
290       {
291         apply_pragma_weak (decl, TREE_VALUE (t));
292         *p = TREE_CHAIN (t);
293         break;
294       }
295 }
296
297 /* Process all "#pragma weak A = B" directives where we have not seen
298    a decl for A.  */
299 void
300 maybe_apply_pending_pragma_weaks (void)
301 {
302   tree *p, t, alias_id, id, decl, *next;
303
304   for (p = &pending_weaks; (t = *p) ; p = next)
305     {
306       next = &TREE_CHAIN (t);
307       alias_id = TREE_PURPOSE (t);
308       id = TREE_VALUE (t);
309
310       if (TREE_VALUE (t) == NULL)
311         continue;
312
313       decl = build_decl (FUNCTION_DECL, alias_id, default_function_type);
314
315       DECL_ARTIFICIAL (decl) = 1;
316       TREE_PUBLIC (decl) = 1;
317       DECL_EXTERNAL (decl) = 1;
318       DECL_WEAK (decl) = 1;
319
320       assemble_alias (decl, id);
321     }
322 }
323
324 /* #pragma weak name [= value] */
325 static void
326 handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
327 {
328   tree name, value, x, decl;
329   enum cpp_ttype t;
330
331   value = 0;
332
333   if (c_lex (&name) != CPP_NAME)
334     GCC_BAD ("malformed #pragma weak, ignored");
335   t = c_lex (&x);
336   if (t == CPP_EQ)
337     {
338       if (c_lex (&value) != CPP_NAME)
339         GCC_BAD ("malformed #pragma weak, ignored");
340       t = c_lex (&x);
341     }
342   if (t != CPP_EOF)
343     warning (0, "junk at end of #pragma weak");
344
345   decl = identifier_global_value (name);
346   if (decl && DECL_P (decl))
347     {
348       apply_pragma_weak (decl, value);
349       if (value)
350         assemble_alias (decl, value);
351     }
352   else
353     pending_weaks = tree_cons (name, value, pending_weaks);
354 }
355 #else
356 void
357 maybe_apply_pragma_weak (tree ARG_UNUSED (decl))
358 {
359 }
360
361 void
362 maybe_apply_pending_pragma_weaks (void)
363 {
364 }
365 #endif /* HANDLE_PRAGMA_WEAK */
366
367 /* GCC supports two #pragma directives for renaming the external
368    symbol associated with a declaration (DECL_ASSEMBLER_NAME), for
369    compatibility with the Solaris and Tru64 system headers.  GCC also
370    has its own notation for this, __asm__("name") annotations.
371
372    Corner cases of these features and their interaction:
373
374    1) Both pragmas silently apply only to declarations with external
375       linkage (that is, TREE_PUBLIC || DECL_EXTERNAL).  Asm labels
376       do not have this restriction.
377
378    2) In C++, both #pragmas silently apply only to extern "C" declarations.
379       Asm labels do not have this restriction.
380
381    3) If any of the three ways of changing DECL_ASSEMBLER_NAME is
382       applied to a decl whose DECL_ASSEMBLER_NAME is already set, and the
383       new name is different, a warning issues and the name does not change.
384
385    4) The "source name" for #pragma redefine_extname is the DECL_NAME,
386       *not* the DECL_ASSEMBLER_NAME.
387
388    5) If #pragma extern_prefix is in effect and a declaration occurs
389       with an __asm__ name, the #pragma extern_prefix is silently
390       ignored for that declaration.
391
392    6) If #pragma extern_prefix and #pragma redefine_extname apply to
393       the same declaration, whichever triggered first wins, and a warning
394       is issued.  (We would like to have #pragma redefine_extname always
395       win, but it can appear either before or after the declaration, and
396       if it appears afterward, we have no way of knowing whether a modified
397       DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.)  */
398
399 static GTY(()) tree pending_redefine_extname;
400
401 static void handle_pragma_redefine_extname (cpp_reader *);
402
403 /* #pragma redefine_extname oldname newname */
404 static void
405 handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
406 {
407   tree oldname, newname, decl, x;
408   enum cpp_ttype t;
409
410   if (c_lex (&oldname) != CPP_NAME)
411     GCC_BAD ("malformed #pragma redefine_extname, ignored");
412   if (c_lex (&newname) != CPP_NAME)
413     GCC_BAD ("malformed #pragma redefine_extname, ignored");
414   t = c_lex (&x);
415   if (t != CPP_EOF)
416     warning (0, "junk at end of #pragma redefine_extname");
417
418   if (!flag_mudflap && !targetm.handle_pragma_redefine_extname)
419     {
420       if (warn_unknown_pragmas > in_system_header)
421         warning (OPT_Wunknown_pragmas,
422                  "#pragma redefine_extname not supported on this target");
423       return;
424     }
425
426   decl = identifier_global_value (oldname);
427   if (decl
428       && (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl))
429       && (TREE_CODE (decl) == FUNCTION_DECL
430           || TREE_CODE (decl) == VAR_DECL)
431       && has_c_linkage (decl))
432     {
433       if (DECL_ASSEMBLER_NAME_SET_P (decl))
434         {
435           const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
436           name = targetm.strip_name_encoding (name);
437
438           if (strcmp (name, IDENTIFIER_POINTER (newname)))
439             warning (0, "#pragma redefine_extname ignored due to conflict with "
440                      "previous rename");
441         }
442       else
443         change_decl_assembler_name (decl, newname);
444     }
445   else
446     /* We have to add this to the rename list even if there's already
447        a global value that doesn't meet the above criteria, because in
448        C++ "struct foo {...};" puts "foo" in the current namespace but
449        does *not* conflict with a subsequent declaration of a function
450        or variable foo.  See g++.dg/other/pragma-re-2.C.  */
451     add_to_renaming_pragma_list (oldname, newname);
452 }
453
454 /* This is called from here and from ia64.c.  */
455 void
456 add_to_renaming_pragma_list (tree oldname, tree newname)
457 {
458   tree previous = purpose_member (oldname, pending_redefine_extname);
459   if (previous)
460     {
461       if (TREE_VALUE (previous) != newname)
462         warning (0, "#pragma redefine_extname ignored due to conflict with "
463                  "previous #pragma redefine_extname");
464       return;
465     }
466   
467   pending_redefine_extname
468     = tree_cons (oldname, newname, pending_redefine_extname);
469 }
470
471 static GTY(()) tree pragma_extern_prefix;
472
473 /* #pragma extern_prefix "prefix" */
474 static void
475 handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy))
476 {
477   tree prefix, x;
478   enum cpp_ttype t;
479
480   if (c_lex (&prefix) != CPP_STRING)
481     GCC_BAD ("malformed #pragma extern_prefix, ignored");
482   t = c_lex (&x);
483   if (t != CPP_EOF)
484     warning (0, "junk at end of #pragma extern_prefix");
485
486   if (targetm.handle_pragma_extern_prefix)
487     /* Note that the length includes the null terminator.  */
488     pragma_extern_prefix = (TREE_STRING_LENGTH (prefix) > 1 ? prefix : NULL);
489   else if (warn_unknown_pragmas > in_system_header)
490     warning (OPT_Wunknown_pragmas,
491              "#pragma extern_prefix not supported on this target");
492 }
493
494 /* Hook from the front ends to apply the results of one of the preceding
495    pragmas that rename variables.  */
496
497 tree
498 maybe_apply_renaming_pragma (tree decl, tree asmname)
499 {
500   tree *p, t;
501
502   /* The renaming pragmas are only applied to declarations with
503      external linkage.  */
504   if ((TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
505       || (!TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl))
506       || !has_c_linkage (decl))
507     return asmname;
508
509   /* If the DECL_ASSEMBLER_NAME is already set, it does not change,
510      but we may warn about a rename that conflicts.  */
511   if (DECL_ASSEMBLER_NAME_SET_P (decl))
512     {
513       const char *oldname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
514       oldname = targetm.strip_name_encoding (oldname);
515
516       if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldname))
517           warning (0, "asm declaration ignored due to "
518                    "conflict with previous rename");
519
520       /* Take any pending redefine_extname off the list.  */
521       for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t))
522         if (DECL_NAME (decl) == TREE_PURPOSE (t))
523           {
524             /* Only warn if there is a conflict.  */
525             if (strcmp (IDENTIFIER_POINTER (TREE_VALUE (t)), oldname))
526               warning (0, "#pragma redefine_extname ignored due to "
527                        "conflict with previous rename");
528
529             *p = TREE_CHAIN (t);
530             break;
531           }
532       return 0;
533     }
534
535   /* Find out if we have a pending #pragma redefine_extname.  */
536   for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t))
537     if (DECL_NAME (decl) == TREE_PURPOSE (t))
538       {
539         tree newname = TREE_VALUE (t);
540         *p = TREE_CHAIN (t);
541
542         /* If we already have an asmname, #pragma redefine_extname is
543            ignored (with a warning if it conflicts).  */
544         if (asmname)
545           {
546             if (strcmp (TREE_STRING_POINTER (asmname),
547                         IDENTIFIER_POINTER (newname)) != 0)
548               warning (0, "#pragma redefine_extname ignored due to "
549                        "conflict with __asm__ declaration");
550             return asmname;
551           }
552
553         /* Otherwise we use what we've got; #pragma extern_prefix is
554            silently ignored.  */
555         return build_string (IDENTIFIER_LENGTH (newname),
556                              IDENTIFIER_POINTER (newname));
557       }
558
559   /* If we've got an asmname, #pragma extern_prefix is silently ignored.  */
560   if (asmname)
561     return asmname;
562
563   /* If #pragma extern_prefix is in effect, apply it.  */
564   if (pragma_extern_prefix)
565     {
566       const char *prefix = TREE_STRING_POINTER (pragma_extern_prefix);
567       size_t plen = TREE_STRING_LENGTH (pragma_extern_prefix) - 1;
568
569       const char *id = IDENTIFIER_POINTER (DECL_NAME (decl));
570       size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl));
571         
572       char *newname = (char *) alloca (plen + ilen + 1);
573
574       memcpy (newname,        prefix, plen);
575       memcpy (newname + plen, id, ilen + 1);
576
577       return build_string (plen + ilen, newname);
578     }
579
580   /* Nada.  */
581   return 0;
582 }
583
584
585 #ifdef HANDLE_PRAGMA_VISIBILITY
586 static void handle_pragma_visibility (cpp_reader *);
587
588 /* Sets the default visibility for symbols to something other than that
589    specified on the command line.  */
590 static void
591 handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
592 { /* Form is #pragma GCC visibility push(hidden)|pop */
593   static int visstack [16], visidx;
594   tree x;
595   enum cpp_ttype token;
596   enum { bad, push, pop } action = bad;
597  
598   token = c_lex (&x);
599   if (token == CPP_NAME)
600     {
601       const char *op = IDENTIFIER_POINTER (x);
602       if (!strcmp (op, "push"))
603         action = push;
604       else if (!strcmp (op, "pop"))
605         action = pop;
606     }
607   if (bad == action)
608     GCC_BAD ("#pragma GCC visibility must be followed by push or pop");
609   else
610     {
611       if (pop == action)
612         {
613           if (!visidx)
614             {
615               GCC_BAD ("No matching push for %<#pragma GCC visibility pop%>");
616             }
617           else
618             {
619               default_visibility = visstack[--visidx];
620               visibility_options.inpragma = (visidx>0);
621             }
622         }
623       else
624         {
625           if (c_lex (&x) != CPP_OPEN_PAREN)
626             GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
627           token = c_lex (&x);
628           if (token != CPP_NAME)
629             {
630               GCC_BAD ("malformed #pragma GCC visibility push");
631             }
632           else if (visidx >= 16)
633             {
634               GCC_BAD ("No more than sixteen #pragma GCC visibility pushes allowed at once");
635             }
636           else
637             {
638               const char *str = IDENTIFIER_POINTER (x);
639               visstack[visidx++] = default_visibility;
640               if (!strcmp (str, "default"))
641                 default_visibility = VISIBILITY_DEFAULT;
642               else if (!strcmp (str, "internal"))
643                 default_visibility = VISIBILITY_INTERNAL;
644               else if (!strcmp (str, "hidden"))
645                 default_visibility = VISIBILITY_HIDDEN;  
646               else if (!strcmp (str, "protected"))
647                 default_visibility = VISIBILITY_PROTECTED;
648               else
649                 {
650                   GCC_BAD ("#pragma GCC visibility push() must specify default, internal, hidden or protected");
651                 }
652               visibility_options.inpragma = 1;
653             }
654           if (c_lex (&x) != CPP_CLOSE_PAREN)
655             GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
656         }
657     }
658   if (c_lex (&x) != CPP_EOF)
659     warning (0, "junk at end of %<#pragma GCC visibility%>");
660 }
661
662 #endif
663
664 /* Front-end wrappers for pragma registration to avoid dragging
665    cpplib.h in almost everywhere.  */
666 void
667 c_register_pragma (const char *space, const char *name,
668                    void (*handler) (struct cpp_reader *))
669 {
670   cpp_register_pragma (parse_in, space, name, handler, 0);
671 }
672
673 void
674 c_register_pragma_with_expansion (const char *space, const char *name,
675                                   void (*handler) (struct cpp_reader *))
676 {
677   cpp_register_pragma (parse_in, space, name, handler, 1);
678 }
679
680 /* Set up front-end pragmas.  */
681 void
682 init_pragma (void)
683 {
684 #ifdef HANDLE_PRAGMA_PACK
685 #ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
686   c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
687 #else
688   c_register_pragma (0, "pack", handle_pragma_pack);
689 #endif
690 #endif
691 #ifdef HANDLE_PRAGMA_WEAK
692   c_register_pragma (0, "weak", handle_pragma_weak);
693 #endif
694 #ifdef HANDLE_PRAGMA_VISIBILITY
695   c_register_pragma ("GCC", "visibility", handle_pragma_visibility);
696 #endif
697
698   c_register_pragma (0, "redefine_extname", handle_pragma_redefine_extname);
699   c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix);
700
701   c_register_pragma ("GCC", "pch_preprocess", c_common_pch_pragma);
702
703 #ifdef REGISTER_TARGET_PRAGMAS
704   REGISTER_TARGET_PRAGMAS ();
705 #endif
706 }
707
708 #include "gt-c-pragma.h"