File: n_28.c

package info (click to toggle)
mcpp 2.7.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,152 kB
  • ctags: 29,136
  • sloc: ansic: 35,238; sh: 9,241; makefile: 176; cpp: 84; exp: 18
file content (40 lines) | stat: -rw-r--r-- 735 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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* n_28.c:  __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ and
            __STDC_VERSION__ are predefined.    */

#include    "defs.h"

main( void)
{
    char *  date = __DATE__;
    char *  fname = __FILE__;

    fputs( "started\n", stderr);

/* 28.1:    */
/* Remove directory part (if any).  */
    fname += strlen( fname) - 6;
    assert( strcmp( fname, "n_28.c") == 0);

/* 28.2:    */
    assert( __LINE__ == 19);

/* 28.3:    */
    assert( strlen( __DATE__) == 11);
    assert( date[ 4] != '0');

/* 28.4:    */
    assert( strlen( __TIME__) == 8);

/* 28.5:    */
    assert( __STDC__);

/* 28.6:    */
    assert( __STDC_VERSION__);

/* 28.7:    */
#include    "line.h"

    fputs( "success\n", stderr);
    return  0;
}