mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-25 16:50:49 +08:00
re PR c/28286 (ICE with invalid value in #pragma pack)
PR c/28286 * c-pragma.c (handle_pragma_pack): Handle invalid constants. * gcc.dg/pragma-pack-4.c: New test. From-SVN: r115548
This commit is contained in:
parent
e1cf56b1d9
commit
12050e4423
@ -1,3 +1,8 @@
|
||||
2006-07-18 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
PR c/28286
|
||||
* c-pragma.c (handle_pragma_pack): Handle invalid constants.
|
||||
|
||||
2006-07-18 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
PR c/26993
|
||||
|
@ -160,6 +160,8 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
|
||||
}
|
||||
else if (token == CPP_NUMBER)
|
||||
{
|
||||
if (TREE_CODE (x) != INTEGER_CST)
|
||||
GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
|
||||
align = TREE_INT_CST_LOW (x);
|
||||
action = set;
|
||||
if (pragma_lex (&x) != CPP_CLOSE_PAREN)
|
||||
@ -190,6 +192,8 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
|
||||
}
|
||||
else if (token == CPP_NUMBER && action == push && align == -1)
|
||||
{
|
||||
if (TREE_CODE (x) != INTEGER_CST)
|
||||
GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
|
||||
align = TREE_INT_CST_LOW (x);
|
||||
if (align == -1)
|
||||
action = set;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2006-07-18 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
PR c/28286
|
||||
* gcc.dg/pragma-pack-4.c: New test.
|
||||
|
||||
2006-07-17 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
PR c++/28291
|
||||
|
6
gcc/testsuite/gcc.dg/pragma-pack-4.c
Normal file
6
gcc/testsuite/gcc.dg/pragma-pack-4.c
Normal file
@ -0,0 +1,6 @@
|
||||
/* PR c/28286 */
|
||||
/* { dg-do compile } */
|
||||
|
||||
#pragma pack(0.5) /* { dg-warning "invalid constant" } */
|
||||
#pragma pack(push,0.5) /* { dg-warning "invalid constant" } */
|
||||
#pragma pack(push,x,0.5) /* { dg-warning "invalid constant" } */
|
Loading…
x
Reference in New Issue
Block a user