summaryrefslogtreecommitdiff
path: root/gcc/fixinc/inclhack.def
diff options
context:
space:
mode:
authorGavin Romig-Koch <gavin@cygnus.com>1999-10-15 06:00:29 +0000
committerJeff Law <law@gcc.gnu.org>1999-10-15 00:00:29 -0600
commitabf7cec73ac948b2c8f700aee818814102c124f9 (patch)
tree26fb88bd420cee94807a4d02fbb3ccde23b41ec5 /gcc/fixinc/inclhack.def
parent1c784a0eeb19b3d256c02a43e0475f9872d30aa4 (diff)
downloadgcc-abf7cec73ac948b2c8f700aee818814102c124f9.tar.gz
fixincludes: Add a HPUX 11 fix for inttypes.h.
* fixincludes: Add a HPUX 11 fix for inttypes.h. * fixinc/inclhack.def: Same. * fixinc/inclhack.sh, fixinc/fixincl.sh, fixinc/fixincl.x: Regenerate. From-SVN: r30004
Diffstat (limited to 'gcc/fixinc/inclhack.def')
-rw-r--r--gcc/fixinc/inclhack.def22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index a02efb55044..ac0979237e1 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -698,6 +698,28 @@ fix = {
sed = "s/^extern struct sigevent;/struct sigevent;/";
};
+/*
+ * In inttypes.h on HPUX 11, the use of __CONCAT__ in the definition
+ * of UINT32_C has undefined behavior according to ISO/ANSI:
+ * the arguments to __CONCAT__ are not macro expanded before the
+ * concatination happens so the trailing ')' in the first argument
+ * is concatinated with the 'l' in the second argument creating an
+ * invalid pp token. The behavior of invalid pp tokens is undefined.
+ * GCC does not handle these invalid tokens the way the HP compiler does.
+ * This problem will potentially occur anytime macros are used in the
+ * arguments to __CONCAT__. A general solution to this problem would be to
+ * insert another layer of macro between __CONCAT__ and its use
+ * in UINT32_C. An example of this solution can be found in the C standard.
+ * A more specific solution, the one used here, is to change the UINT32_C
+ * macro to not used macros in the arguments to __CONCAT__.
+ */
+
+fix = {
+ hackname = hpux11_uint32_c;
+ files = inttypes.h;
+ select = "^#define UINT32_C\\(__c\\)[ \t]*__CONCAT__\\(__CONCAT_U__\\(__c\\),l\\)";
+ sed = "s/^#define UINT32_C(__c)\\([ \t]*\\)__CONCAT__(__CONCAT_U__(__c),l)/#define UINT32_C(__c)\\1__CONCAT__(__c,ul)/";
+};
/*
* Determine if we're on Interactive Unix 2.2 or later, in which case we