Patchwork [vms/committed] : Handle #pragma __nomember_alignment byte

login
register
mail settings
Submitter Tristan Gingold
Date April 3, 2012, 8:50 a.m.
Message ID <E940457A-34D4-46D4-8E70-C7C41BCC243A@adacore.com>
Download mbox | patch
Permalink /patch/150346/
State New
Headers show

Comments

Tristan Gingold - April 3, 2012, 8:50 a.m.
Hi,

this patch handles the 'byte' alignment that appears in standard VMS headers when a C++ compiler is used.
It also force the support of parameterless variadic functions to be compatible with standard VMS headers.

Committed on trunk after ia64-hp-openvms cross build.

Tristan.

2012-04-03  Tristan Gingold  <gingold@adacore.com>

	* config/vms/vms-c.c (vms_pragma_nomember_alignment): Handle
	'byte' alignment.
	(vms_c_common_override_options): Allow parameterless variadic
	functions.

Patch

Index: gcc/config/vms/vms-c.c
===================================================================
--- gcc/config/vms/vms-c.c	(revision 186100)
+++ gcc/config/vms/vms-c.c	(working copy)
@@ -120,7 +120,9 @@ 
       if (arg[0] == '_' && arg[1] == '_')
         arg += 2;
 
-      if (strcmp (arg, "word") == 0)
+      if (strcmp (arg, "byte") == 0)
+        maximum_field_alignment = 1 * BITS_PER_UNIT;
+      else if (strcmp (arg, "word") == 0)
         maximum_field_alignment = 2 * BITS_PER_UNIT;
       else if (strcmp (arg, "longword") == 0)
         maximum_field_alignment = 4 * BITS_PER_UNIT;
@@ -453,6 +455,9 @@ 
 void
 vms_c_common_override_options (void)
 {
+  /* Allow variadic functions without parameters (as declared in starlet).  */
+  flag_allow_parameterless_variadic_functions = TRUE;
+
   /* Initialize c_default_pointer_mode.  */
   switch (flag_vms_pointer_size)
     {