diff options
author | Joseph Myers <joseph@codesourcery.com> | 2005-11-03 03:30:36 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2005-11-03 03:30:36 +0000 |
commit | a92c58c27304547c9c75e4cbb0a2ad92f55c17e0 (patch) | |
tree | 0bb7ecb15bb976867a17f2fbee102eb3956a45b4 /gcc/testsuite | |
parent | 150cdc9e16e86173fe7116e12dbcc4cc8fb6b789 (diff) | |
download | gcc-a92c58c27304547c9c75e4cbb0a2ad92f55c17e0.zip gcc-a92c58c27304547c9c75e4cbb0a2ad92f55c17e0.tar.gz gcc-a92c58c27304547c9c75e4cbb0a2ad92f55c17e0.tar.bz2 |
re PR c/24329 (segfault with -Wall and long integer literal)
PR c/24329
* c-pretty-print.c (pp_c_type_specifier): Do not recurse if
c_common_type_for_mode returns an unnamed type.
testsuite:
* gcc.dg/format/unnamed-1.c: New test.
From-SVN: r106421
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/format/unnamed-1.c | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b52603b..3934527 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-11-03 Joseph S. Myers <joseph@codesourcery.com> + + PR c/24329 + * gcc.dg/format/unnamed-1.c: New test. + 2005-11-02 Mark Mitchell <mark@codesourcery.com> PR c++/22434 diff --git a/gcc/testsuite/gcc.dg/format/unnamed-1.c b/gcc/testsuite/gcc.dg/format/unnamed-1.c new file mode 100644 index 0000000..5fc11a1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/unnamed-1.c @@ -0,0 +1,22 @@ +/* Test for warnings with possibly unnamed integer types. Bug 24329. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ + +#include "format.h" + +/* Definition of TItype follows same logic as in gcc.dg/titype-1.c, + but must be a #define to avoid giving the type a name. */ +#if defined(__LP64__) && !defined(__hppa__) +#define TItype int __attribute__ ((mode (TI))) +#else +#define TItype long +#endif + +void +f (TItype x) +{ + printf("%d", x); /* { dg-warning "expects type" } */ + printf("%d", 141592653589793238462643383279502884197169399375105820974944); /* { dg-warning "expects type" } */ + /* { dg-warning "unsigned only|too large" "constant" { target *-*-* } 20 } */ +} |