home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lclint.zip / lclint-2_3h-os2-bin.zip / test / ulstypes.c < prev    next >
Text File  |  1997-09-03  |  649b  |  26 lines

  1. unsigned int ui;
  2. long int li;
  3. long unsigned short si; /* 1. contradictory qualifiers */
  4.  
  5. long int f (unsigned int x)
  6. {
  7.   long int loli = 12;
  8.   int loc = 3;
  9.  
  10.   loc = f (li);    /* 2, 3. pass long as unsigned, assign unsigned to int */
  11.   loc = f (ui);    /* 4. assign unsigned to int */
  12.   loc = f (loc);   /* 5, 6. pass int as unsigned, assign unsigned to int */
  13.  
  14.   loli = loc;      /* [7. if -relaxquals] */
  15.   return x;        /* 7. return unsigned int as long int */
  16. }
  17.  
  18. unsigned int x1 = 0;
  19. unsigned int x2 = 23;
  20. unsigned int x3 = -15; /* 8. assign -15 to unsigned */
  21. unsigned int x4 = -15U; 
  22. long int x5 = 0L;
  23. long int x6 = 0;
  24. short int x7 = 14; 
  25.  
  26.