summaryrefslogtreecommitdiff
path: root/gcc/c-pragma.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-09 02:16:12 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-09 02:16:12 +0000
commit504687d0d2cace41536f255f04ddcee6dfa227a4 (patch)
tree409dc9e147cd73c81e6558344513d4a13f345618 /gcc/c-pragma.c
parent8ed734395e40b780c878b97f653ca5483827e9b6 (diff)
downloadgcc-504687d0d2cace41536f255f04ddcee6dfa227a4.tar.gz
* c-pragma.c (handle_pragma_token): Handle `#pragma pack()'
correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27432 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r--gcc/c-pragma.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index eedd0a13f0d..de9cfb899e5 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -383,8 +383,17 @@ handle_pragma_token (string, token)
case ps_left:
if (token == NULL_TREE)
- state = (strcmp (string, ")") ? ps_bad : ps_right);
-
+ {
+ /* #pragma pack () resets packing rules to their
+ defaults. */
+ if (strcmp (string, ")") == 0)
+ {
+ align = 0;
+ state = ps_right;
+ }
+ else
+ state = ps_bad;
+ }
else if (TREE_CODE (token) == INTEGER_CST)
goto handle_align;