mm2 / Little-CMS

A free, open source, CMM engine. It provides fast transforms between ICC profiles.
https://www.littlecms.com
MIT License
572 stars 177 forks source link

Xcode 13.3 warning on var set but not used in cmstypes.c #312

Closed prrace closed 2 years ago

prrace commented 2 years ago

We had an OpenJDK bug report from some one experimenting with the very latest Xcode 13.3 : https://bugs.openjdk.java.net/browse/JDK-8283221

The gist of it is that OpenJDK defaults to warnings as errors and the latest clang reports

cmstypes.c: parameter 'SizeOfTag' set but not used [-Werror,-Wunused-but-set-parameter] void Type_ProfileSequenceId_Read(struct _cms_typehandler_struct self, cmsIOHANDLER io, cmsUInt32Number nItems, cmsUInt32Number SizeOfTag)

It corresponds to the case fixed in this PR.

I guess there may once have been a subsequent read that needed this check, or perhaps it is just a pattern to make sure a check is always present in case another read is added.