/ Check-in [e4af9675]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix harmless LLVM compiler warnings in the srcck1.c utility program used during the build process.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e4af967533f290862dfba1d9ef44d4c9ddd8a01b
User & Date: drh 2016-05-02 13:57:19
Context
2016-05-02
16:59
Fix a test case in temptable2.test so that it works on systems that lack a coherient cache (ex: OpenBSD) and thus do not support the "PRAGMA mmap_size" command. check-in: 088cf838 user: drh tags: trunk
15:00
Merge enhancements and bug fixes from trunk. check-in: f52765ee user: drh tags: apple-osx
13:57
Fix harmless LLVM compiler warnings in the srcck1.c utility program used during the build process. check-in: e4af9675 user: drh tags: trunk
12:18
Disable the multi-row one-pass DELETE optimization when the WHERE clause contains a subquery. Fix for ticket [dc6ebeda9396087]. check-in: 3f221f59 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to tool/srcck1.c.

   107    107   
   108    108   /* Search for instances of assert(...), ALWAYS(...), NEVER(...), and/or
   109    109   ** testcase(...) where the argument contains side effects.
   110    110   **
   111    111   ** Print error messages whenever a side effect is found.  Return the number
   112    112   ** of problems seen.
   113    113   */
   114         -static unsigned int findAllSideEffects(const unsigned char *z){
          114  +static unsigned int findAllSideEffects(const char *z){
   115    115     unsigned int lineno = 1;   /* Line number */
   116    116     unsigned int i;
   117    117     unsigned int nErr = 0;
   118         -  unsigned char c, prevC = 0;
          118  +  char c, prevC = 0;
   119    119     for(i=0; (c = z[i])!=0; prevC=c, i++){
   120    120       if( c=='\n' ){ lineno++; continue; }
   121    121       if( isalpha(c) && !isalpha(prevC) ){
   122    122         if( strncmp(&z[i],"assert(",7)==0
   123    123          || strncmp(&z[i],"ALWAYS(",7)==0
   124    124          || strncmp(&z[i],"NEVER(",6)==0
   125    125          || strncmp(&z[i],"testcase(",9)==0
   126    126         ){
   127    127           unsigned int n;
   128         -        unsigned const char *z2 = &z[i+5];
          128  +        const char *z2 = &z[i+5];
   129    129           while( z2[0]!='(' ){ z2++; }
   130    130           z2++;
   131    131           n = findCloseParen(z2);
   132    132           if( hasSideEffect(z2, n) ){
   133    133             nErr++;
   134    134             fprintf(stderr, "side-effect line %u: %.*s\n", lineno,
   135    135                     (int)(&z2[n+1] - &z[i]), &z[i]);
................................................................................
   137    137         }
   138    138       }
   139    139     }
   140    140     return nErr;
   141    141   }
   142    142   
   143    143   int main(int argc, char **argv){
   144         -  unsigned char *z;
          144  +  char *z;
   145    145     unsigned int nErr = 0;
   146    146     if( argc!=2 ){
   147    147       fprintf(stderr, "Usage: %s FILENAME\n", argv[0]);
   148    148       return 1;
   149    149     }
   150    150     z = readFile(argv[1]);
   151    151     nErr = findAllSideEffects(z);