I just compiled dt with clang and got (besides tons of false positives) 7 warnings worth looking at:
.../src/libs/lib.c:219:13: warning: if statement has empty body [-Wempty-body] if(blob); ^ .../src/views/lighttable.c:166:3: warning: Declared variable-length array (VLA) has zero size int32_t imgids[count]; ^ --~ .../src/libs/export.c:648:3: warning: Null pointer passed as an argument to a 'nonnull' parameter memcpy(params+pos, fdata, fsize); pos += fsize; ^ --~ .../src/libs/export.c:649:3: warning: Null pointer passed as an argument to a 'nonnull' parameter memcpy(params+pos, sdata, ssize); pos += ssize; ^ --~ .../src/iop/demosaic.c:128:69: warning: The left operand of '>' is a garbage value for (int i=0;i<8;i++) for(int ii=i+1;ii<9;ii++) if(med[i] > med[ii]) SWAP(med[i], med[ii]); --- ^ .../src/imageio/storage/flickr.c:649:102: warning: Dereference of null pointer flickcurl_photosets_addPhoto (p->flickr_api->fc, p->flickr_api->current_album->id, photo_status->photoid); ^ .../imageio/storage/flickr.c:633:76: warning: Dereference of null pointer photoset_id = _flickr_api_create_photoset(p->flickr_api, photo_status->photoid); ^
#2 Updated by Tobias Ellinghaus almost 8 years ago
I have just found some time to run the static code checker. After fixing the trivial stuff there are 56 issues left. Please have a look at the provided reports (open clang/2011-01-10-1/index.html in a browser) and fix whatever is in code you feel responsible for. However make sure that it's not a false positive (there are some, clang doesn't seem to like aliasing).
#3 Updated by Tobias Ellinghaus almost 8 years ago
Hmm, the file was too big to attach here. Get it from http://www.stud.uni-saarland.de/~jeel5001/clang.tbz
#7 Updated by Tobias Ellinghaus over 6 years ago
Since we moved our website to darktable.org I can no longer update the clang output, since darktable.sf.net/clang/ can't be reached any more. I need ftp/ssh access on darktable.org to make this work again. Or we have to fix the forward from sf.net to our new site to exclude that directory.
Regards closing, this ticket is supposed to stay open to remind us to check our code from time to time.