Hello,

I am using SQLite 3.8.2 for my iOS projects in Xcode 5.0.2. After updating to 
version 3.8.2 I am getting the following compiler warning:

sqlite3.c:28141:13: Unused variable ‘pFd’

When looking into the code I see starting at line 28141:

static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
  unixFile *pFd = (unixFile *)fd;   /* The underlying database file */
  UNUSED_PARAMETER(iOff);

#if SQLITE_MAX_MMAP_SIZE>0
  … the code of the function
#endif
  return SQLITE_OK;
}

Obviously the compiler switch “#if SQLITE_MAX_MMAP_SIZE>0” instructs the 
compiler to ignore the code inside the switch on my platform. As a result the 
variable “pFd” is never used and results in an ugly warning message. Would it 
be better to include the variable declaration inside the compiler switch to 
protect from this warning? So the code would look like this:

static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
#if SQLITE_MAX_MMAP_SIZE>0
  unixFile *pFd = (unixFile *)fd;   /* The underlying database file */
  UNUSED_PARAMETER(iOff);
  … the code of the function
#endif
  return SQLITE_OK;
}

Best regards

Matthias Schmitt

magic moving pixel s.a.
23, Avenue Grande-Duchesse Charlotte
L-3441 Dudelange
Luxembourg
Phone: +352 54 75 75 - 0
http://www.mmp.lu




_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to