home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_04 / v7n4055a.txt < prev    next >
Text File  |  1989-03-01  |  2KB  |  53 lines

  1. /*
  2.  *  zansi2.c - legal ANSI constructs rejected by Zortech compilers.
  3.  */
  4.  
  5. #include <stddef.h>
  6.  
  7. typedef struct  foo FOO;
  8. struct  foo {
  9.     int     a, b;
  10.     FOO     *left, *right;
  11.     };
  12.  
  13. /*
  14.  *  In ANSI C, each occurrence of a "trigraph" must be replaced
  15.  *  by a single character.  One such trigraph is "??(", which must
  16.  *  by replaced by "[".
  17.  */
  18. char    feeb??(4] = "Are trigraphs supported?";
  19.             ^
  20. "zansi2.cpp", line 18 Syntax error: '=', ';' or ',' expected
  21.  
  22.  
  23.     main(int argc, char **argv)
  24. {
  25. long double foo = 1.2L; /* L suffix means long double constant */
  26.                      ^
  27. "zansi2.cpp", line 22 Syntax error: '=', ';' or ',' expected
  28.  
  29. float       fee = 1.2F; /* F suffix means float (default would be double) */
  30.                      ^
  31. "zansi2.cpp", line 23 Syntax error: '=', ';' or ',' expected
  32.  
  33. /*
  34.  *  The language specification for C++ is too vague to determine whether or
  35.  *  not it allows auto aggregate initializers.  ANSI C, however, explicitly
  36.  *  allows them, so C++ will presumably follow suit.
  37.  */
  38. FOO         x   = { 1, 2 }; /* ANSI C allows auto aggregate initializers */
  39.                   ^
  40. "zansi2.cpp", line 29 Syntax error: can't init auto structs or auto arrays
  41.  
  42. size_t      offset;
  43. wchar_t     wide_char_type; /* wchar_t is required in stddef.h */
  44.                          ^
  45. "zansi2.cpp", line 31 Syntax error: undefined identifier 'wchar_t'
  46.  
  47.     offset  = offsetof(FEE, b); /* offsetof is required in stddef.h */
  48.                           ^
  49. "zansi2.cpp", line 33 Syntax error: undefined identifier 'FEE'
  50.  
  51.     
  52. }
  53.