File: warn_2.c

package info (click to toggle)
mcpp 2.7.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,024 kB
  • ctags: 29,151
  • sloc: ansic: 35,191; sh: 9,231; makefile: 176; cpp: 84; exp: 18
file content (19 lines) | stat: -rw-r--r-- 555 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* warn_2.c */

/*
 *   The following texts are legal but suspicious ones.  Good preprocessor
 * will warn at these texts.
 */

/* { dg-do preprocess } */
/* { dg-options "-ansi -pedantic -Wall" }   */

/* w.2.1:   Negative number converted to positive in #if expression.    */
#if     -1 < 0U     /* { dg-warning "changes sign when promoted| converted to positive" }   */
#endif

/* w.2.2:   Out of range of unsigned type (wraps around and never overflow)
        in #if expression.  */
#if     0U - 1      /* { dg-warning "out of range" }    */
#endif