Blame cpp-test/test-t/warn_2.c
|
Packit Service |
8bf002 |
/* warn_2.c */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/*
|
|
Packit Service |
8bf002 |
* The following texts are legal but suspicious ones. Good preprocessor
|
|
Packit Service |
8bf002 |
* will warn at these texts.
|
|
Packit Service |
8bf002 |
*/
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* { dg-do preprocess } */
|
|
Packit Service |
8bf002 |
/* { dg-options "-ansi -pedantic -Wall" } */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* w.2.1: Negative number converted to positive in #if expression. */
|
|
Packit Service |
8bf002 |
#if -1 < 0U /* { dg-warning "changes sign when promoted| converted to positive" } */
|
|
Packit Service |
8bf002 |
#endif
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* w.2.2: Out of range of unsigned type (wraps around and never overflow)
|
|
Packit Service |
8bf002 |
in #if expression. */
|
|
Packit Service |
8bf002 |
#if 0U - 1 /* { dg-warning "out of range" } */
|
|
Packit Service |
8bf002 |
#endif
|
|
Packit Service |
8bf002 |
|