Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.75k stars 313 forks source link

-Wextra #4155

Closed heckflosse closed 6 years ago

heckflosse commented 6 years ago

I created a new branch extraclean with the intention to get rt clean when built using -Wextra. First commit 9e812bb cleans FTblockDN.cc for -Wextra

To check a compilation unit you can simply add #pragma GCC diagnostic warning "-Wextra" after the last #include line.

gaaned92 commented 6 years ago

Using the -Wextra flag generates huge amount of warnings. Thus you will have a hard work to clean all the code. If I can help don't hesitate to ask.

heckflosse commented 6 years ago

@gaaned92

Using the -Wextra flag generates huge amount of warnings.

That's the reason I use

#pragma GCC diagnostic warning "-Wextra"

after the last #include line per compilation unit.

Here's the list of rtengine compilation units:

gaaned92 commented 6 years ago

GCC7.2.0

for shmap.cc, utils.cc, stdimagesource.cc, slicer.cc, simpleprocess.cc, shmap.cc

In function '_ZN8rtengine14RawImageSource10cfa_linednEf._omp_fn.0':
cc1plus.exe: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
Y:/RTSOURCE/rawtherapee/rtengine/rtlensfun.cc: In member function 'virtual void rtengine::LFModifier::correctCA(double&, double&, int) const':
Y:/RTSOURCE/rawtherapee/rtengine/rtlensfun.cc:79:36: warning: unused parameter  x' [-Wunused-parameter]
 void LFModifier::correctCA(double &x, double &y, int channel) const
                                    ^
Y:/RTSOURCE/rawtherapee/rtengine/rtlensfun.cc:79:47: warning: unused parameter  y' [-Wunused-parameter]
 void LFModifier::correctCA(double &x, double &y, int channel) const
                                               ^
Y:/RTSOURCE/rawtherapee/rtengine/rtlensfun.cc:79:54: warning: unused parameter  channel' [-Wunused-parameter]
 void LFModifier::correctCA(double &x, double &y, int channel) const
                                                      ^~~~~~~
Y:/RTSOURCE/rawtherapee/rtengine/stdimagesource.cc: In member function 'virtual void rtengine::StdImageSource::getImage(const rtengine::ColorTemp&, int, rtengine::Imagefloat*, const PreviewProps&, const rtengine::procparams::ToneCurveParams&, const rtengine::procparams::RAWParams&)':
Y:/RTSOURCE/rawtherapee/rtengine/stdimagesource.cc:190:154: warning: unused parameter 'raw' [-Wunused-parameter]
 void StdImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw)
                                                                                                                                                          ^~~
Y:/RTSOURCE/rawtherapee/rtengine/stdimagesource.cc: In member function 'virtual void rtengine::StdImageSource::convertColorSpace(rtengine::Imagefloat*, const rtengine::procparams::ColorManagementParams&, const rtengine::ColorTemp&)':
Y:/RTSOURCE/rawtherapee/rtengine/stdimagesource.cc:211:110: warning: unused parameter 'wb' [-Wunused-parameter]
 void StdImageSource::convertColorSpace(Imagefloat* image, const ColorManagementParams &cmp, const ColorTemp &wb)
                                                                                                              ^~
gaaned92 commented 6 years ago

for refreshmap.cc, rawimage.cc, profilestore.cc, processingjob.cc, previewimage.cc, pixelshift.cc no warning

gaaned92 commented 6 years ago

for pipettebuffer.cc, myfile.cc, loadinitial.cc, lcp.cc, klt/writefeatures.cc, klt/trckfeatures.cc, klt/storefeatures.cc


Y:/RTSOURCE/rawtherapee/rtengine/myfile.cc: In function 'void* mmap(void*, size_t, int, int, int, off_t)':
Y:/RTSOURCE/rawtherapee/rtengine/myfile.cc:36:44: warning: unused parameter 'prot' [-Wunused-parameter]
 void* mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
                                            ^~~~
Y:/RTSOURCE/rawtherapee/rtengine/myfile.cc:36:54: warning: unused parameter 'flags' [-Wunused-parameter]
 void* mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
                                                      ^~~~~
Y:/RTSOURCE/rawtherapee/rtengine/myfile.cc: In function 'int munmap(void*, size_t)':
Y:/RTSOURCE/rawtherapee/rtengine/myfile.cc:49:32: warning: unused parameter 'length' [-Wunused-parameter]
 int munmap(void *start, size_t length)
                                ^~~~~~
gaaned92 commented 6 years ago

for all other /klt .cc files no warning

Floessie commented 6 years ago

With GCC 7.2.0 I got an extra warning and (worse) an error. Here's the fix for both:

diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc
index d9005347..47688fca 100644
--- a/rtengine/imagedata.cc
+++ b/rtengine/imagedata.cc
@@ -857,8 +857,7 @@ bool FramesData::hasIPTC (unsigned int frame) const
 tm FramesData::getDateTime (unsigned int frame) const
 {
     if (frames.empty() || frame >= frames.size() ) {
-        tm emptytm = {0, 0, 0, 0, 0, 0, 0, 0, 0};
-        return emptytm;
+        return {};
     } else {
         return frames.at(frame)->getDateTime ();
     }
diff --git a/rtengine/labimage.cc b/rtengine/labimage.cc
index 4cd5ce31..bcadda0e 100644
--- a/rtengine/labimage.cc
+++ b/rtengine/labimage.cc
@@ -17,9 +17,11 @@
  *  along with RawTherapee.  If not, see <http://www.gnu.org/licenses/>.
  */

-#include "labimage.h"
+#include <cstring>
 #include <memory>

+#include "labimage.h"
+
 namespace rtengine
 {

Best, Flössie

gaaned92 commented 6 years ago

for jpegmemsrc.cc, jdatsrc.cc, ipvibrance.cc, iptransform.ccipsharpen.cc, ipretinex.cc, ipresize.cc, iplab2rgb.cc

Y:/RTSOURCE/rawtherapee/rtengine/iplab2rgb.cc: In member function 'rtengine::Image16* rtengine::ImProcFunctions::lab2rgb16(rtengine::LabImage*, int, int, int, int, const rtengine::procparams::ColorManagementParams&, bool, rtengine::GammaValues*)':
Y:/RTSOURCE/rawtherapee/rtengine/iplab2rgb.cc:265:136: warning: unused parameter 'bw' [-Wunused-parameter]
 Image16* ImProcFunctions::lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool bw, GammaValues *ga)
                                                                                                                                        ^~
Y:/RTSOURCE/rawtherapee/rtengine/jdatasrc.cc: In function 'void my_term_source(j_decompress_ptr)':
Y:/RTSOURCE/rawtherapee/rtengine/jdatasrc.cc:192:34: warning: unused parameter  cinfo' [-Wunused-parameter]
 my_term_source (j_decompress_ptr cinfo)
                                  ^~~~~
Y:/RTSOURCE/rawtherapee/rtengine/jpeg_ijg/jpeg_memsrc.cc: In function 'void init_source(j_decompress_ptr)':
Y:/RTSOURCE/rawtherapee/rtengine/jpeg_ijg/jpeg_memsrc.cc:49:31: warning: unused parameter 'cinfo' [-Wunused-parameter]
 init_source (j_decompress_ptr cinfo)
                               ^~~~~
Y:/RTSOURCE/rawtherapee/rtengine/jpeg_ijg/jpeg_memsrc.cc: In function 'void term_source(j_decompress_ptr)':
Y:/RTSOURCE/rawtherapee/rtengine/jpeg_ijg/jpeg_memsrc.cc:137:31: warning: unused parameter 'cinfo' [-Wunused-parameter]
 term_source (j_decompress_ptr cinfo)
                               ^~~~~
Y:/RTSOURCE/rawtherapee/rtengine/iptransform.cc: In member function 'void rtengine::ImProcFunctions::transformGeneral(rtengine::ImProcFunctions::TransformMode, rtengine::Imagefloat*, rtengine::Imagefloat*, int, int, int, int, int, int, int, int, const rtengine::LensCorrection*)':
Y:/RTSOURCE/rawtherapee/rtengine/iptransform.cc:793:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
             enableLCPCA = pLCPMap && params->lensProf.useCA && pLCPMap->isCACorrectionAvailable();
             ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Y:/RTSOURCE/rawtherapee/rtengine/iptransform.cc:797:9: note: here
         case ImProcFunctions::TRANSFORM_HIGH_QUALITY: {
         ^~~~
Y:/RTSOURCE/rawtherapee/rtengine/iptransform.cc:802:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
             enableCA = enableLCPCA || needsCA();
             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Y:/RTSOURCE/rawtherapee/rtengine/iptransform.cc:806:9: note: here
         default:
         ^~~~~~~
heckflosse commented 6 years ago

@Floessie

With GCC 7.2.0 I got an extra warning and (worse) an error.

Strange. I'm also on gcc 7.2.0 and got no error

@gaaned92 Thanks a lot for checking!

gaaned92 commented 6 years ago

Do you intend to do that also for rtexif and rtgui?

heckflosse commented 6 years ago

@gaaned92 yes!

Edit: I know we won't get it completely clean. My intention to get it cleaner than before is not for performance reasons but for the reason not to waste thoughts about unused parameters or other stuff reported by -Wextra in future, so we hopefully can detect newly introduced warnings, which is not the case at the moment as there are too many warnings.

Beep6581 commented 6 years ago

GCC 4.9.3

CA_correct_RT.cc

/home/morgan/programs/code-rawtherapee/rtengine/cJSON.c: In function ‘parse_string’:
/home/morgan/programs/code-rawtherapee/rtengine/cJSON.c:196:9: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
         ^
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc: In member function ‘virtual tm rtengine::FramesData::getDateTime(unsigned int) const’:
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_sec’ [-Wmissing-field-initializers]
         return {};
                 ^
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_min’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_hour’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_mday’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_mon’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_year’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_wday’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_yday’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_isdst’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_gmtoff’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_zone’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/iptransform.cc: In member function ‘void rtengine::ImProcFunctions::transformGeneral(rtengine::ImProcFunctions::TransformMode, rtengine::Imagefloat*, rtengine::Imagefloat*, int, int, int, int, int, int, int, int, const rtengine::LensCorrection*)’:
/home/morgan/programs/code-rawtherapee/rtengine/iptransform.cc:793:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
                                ^
Beep6581 commented 6 years ago

dcp.cc

[  5%] Building CXX object rtengine/CMakeFiles/rtengine.dir/dcp.cc.o
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc: In function ‘rtengine::DCPProfile::Triple {anonymous}::multiply3x3_v3(const Matrix&, const Triple&)’:
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:86:31: warning: missing initializer for member ‘std::array<double, 3ul>::_M_elems’ [-Wmissing-field-initializers]
     DCPProfile::Triple res = {};
                               ^
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc: In function ‘rtengine::DCPProfile::Matrix {anonymous}::mapWhiteMatrix(const Triple&, const Triple&)’:
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:135:29: warning: missing initializer for member ‘std::array<std::array<double, 3ul>, 3ul>::_M_elems’ [-Wmissing-field-initializers]
     DCPProfile::Matrix a = {};
                             ^
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc: In constructor ‘rtengine::DCPProfile::ApplyState::ApplyState()’:
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:392:19: warning: missing initializer for member ‘rtengine::DCPProfile::ApplyState::Data::pro_photo’ [-Wmissing-field-initializers]
     data(new Data{})
                   ^
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:392:19: warning: missing initializer for member ‘rtengine::DCPProfile::ApplyState::Data::work’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:392:19: warning: missing initializer for member ‘rtengine::DCPProfile::ApplyState::Data::already_pro_photo’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:392:19: warning: missing initializer for member ‘rtengine::DCPProfile::ApplyState::Data::use_tone_curve’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:392:19: warning: missing initializer for member ‘rtengine::DCPProfile::ApplyState::Data::apply_look_table’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:392:19: warning: missing initializer for member ‘rtengine::DCPProfile::ApplyState::Data::bl_scale’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc: In member function ‘rtengine::DCPProfile::Matrix rtengine::DCPProfile::makeXyzCam(const rtengine::ColorTemp&, const Triple&, const Matrix&, int) const’:
/home/morgan/programs/code-rawtherapee/rtengine/dcp.cc:1491:19: warning: missing initializer for member ‘std::array<std::array<double, 3ul>, 3ul>::_M_elems’ [-Wmissing-field-initializers]
     Matrix res = {};
                   ^
Beep6581 commented 6 years ago

image8.cc

[  5%] Building CXX object rtengine/CMakeFiles/rtengine.dir/image8.cc.o
/home/morgan/programs/code-rawtherapee/rtengine/image8.cc:60:63: warning: unused parameter ‘bps’ [-Wunused-parameter]
 void Image8::setScanline (int row, unsigned char* buffer, int bps, float *minValue, float *maxValue)
                                                               ^
/home/morgan/programs/code-rawtherapee/rtengine/image8.cc:60:75: warning: unused parameter ‘minValue’ [-Wunused-parameter]
 void Image8::setScanline (int row, unsigned char* buffer, int bps, float *minValue, float *maxValue)
                                                                           ^
/home/morgan/programs/code-rawtherapee/rtengine/image8.cc:60:92: warning: unused parameter ‘maxValue’ [-Wunused-parameter]
 void Image8::setScanline (int row, unsigned char* buffer, int bps, float *minValue, float *maxValue)
                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/image8.cc:99:95: warning: unused parameter ‘first’ [-Wunused-parameter]
 void Image8::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp)
                                                                                               ^
/home/morgan/programs/code-rawtherapee/rtengine/image8.cc:99:130: warning: unused parameter ‘hrp’ [-Wunused-parameter]
 void Image8::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp)
                                                                                                                                  ^
Beep6581 commented 6 years ago

image16.cc

[  5%] Building CXX object rtengine/CMakeFiles/rtengine.dir/image16.cc.o
/home/morgan/programs/code-rawtherapee/rtengine/image16.cc:83:64: warning: unused parameter ‘bps’ [-Wunused-parameter]
 void Image16::setScanline (int row, unsigned char* buffer, int bps, float *minValue, float *maxValue)
                                                                ^
/home/morgan/programs/code-rawtherapee/rtengine/image16.cc:83:76: warning: unused parameter ‘minValue’ [-Wunused-parameter]
 void Image16::setScanline (int row, unsigned char* buffer, int bps, float *minValue, float *maxValue)
                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/image16.cc:83:93: warning: unused parameter ‘maxValue’ [-Wunused-parameter]
 void Image16::setScanline (int row, unsigned char* buffer, int bps, float *minValue, float *maxValue)
                                                                                             ^
/home/morgan/programs/code-rawtherapee/rtengine/image16.cc:138:96: warning: unused parameter ‘first’ [-Wunused-parameter]
 void Image16::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp)
                                                                                                ^
/home/morgan/programs/code-rawtherapee/rtengine/image16.cc:138:131: warning: unused parameter ‘hrp’ [-Wunused-parameter]
 void Image16::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp)
                                                                                                                                   ^
Beep6581 commented 6 years ago

imagedata.cc

[  6%] Building CXX object rtengine/CMakeFiles/rtengine.dir/imagedata.cc.o
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc: In member function ‘virtual tm rtengine::FramesData::getDateTime(unsigned int) const’:
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_sec’ [-Wmissing-field-initializers]
         return {};
                 ^
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_min’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_hour’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_mday’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_mon’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_year’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_wday’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_yday’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_isdst’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_gmtoff’ [-Wmissing-field-initializers]
/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_zone’ [-Wmissing-field-initializers]
Beep6581 commented 6 years ago

imagefloat.cc

[  6%] Building CXX object rtengine/CMakeFiles/rtengine.dir/imagefloat.cc.o
/home/morgan/programs/code-rawtherapee/rtengine/imagefloat.cc:48:67: warning: unused parameter ‘bps’ [-Wunused-parameter]
 void Imagefloat::setScanline (int row, unsigned char* buffer, int bps, float *minValue, float *maxValue)
                                                                   ^
/home/morgan/programs/code-rawtherapee/rtengine/imagefloat.cc:175:99: warning: unused parameter ‘first’ [-Wunused-parameter]
 void Imagefloat::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp)
                                                                                                   ^
/home/morgan/programs/code-rawtherapee/rtengine/imagefloat.cc:175:134: warning: unused parameter ‘hrp’ [-Wunused-parameter]
 void Imagefloat::getStdImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, bool first, procparams::ToneCurveParams hrp)
                                                                                                                                      ^
Beep6581 commented 6 years ago

improccoordinator.cc

[  6%] Building CXX object rtengine/CMakeFiles/rtengine.dir/improccoordinator.cc.o
/home/morgan/programs/code-rawtherapee/rtengine/improccoordinator.cc:1037:49: warning: unused parameter ‘str’ [-Wunused-parameter]
 void ImProcCoordinator::progress (Glib::ustring str, int pr)
                                                 ^
/home/morgan/programs/code-rawtherapee/rtengine/improccoordinator.cc:1037:58: warning: unused parameter ‘pr’ [-Wunused-parameter]
 void ImProcCoordinator::progress (Glib::ustring str, int pr)
                                                          ^
Beep6581 commented 6 years ago

ipsharpen.cc

[  5%] Building CXX object rtengine/CMakeFiles/rtengine.dir/ipsharpen.cc.o
In file included from /home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:22:0:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral05(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:415:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:151:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral05 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral06(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:417:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:163:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral06 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral07(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:419:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:175:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral07 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral08(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:421:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:187:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral08 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral09(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:423:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:199:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral09 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral10(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:425:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:211:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral10 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral11(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:427:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:223:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral11 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral12(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:429:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:235:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral12 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral13(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:431:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:247:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral13 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral14(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:433:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:259:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral14 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral15(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:435:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:271:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral15 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral16(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:437:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:283:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral16 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral17(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:439:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:295:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral17 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral18(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:441:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:307:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral18 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral19(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:443:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:319:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral19 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral20(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:445:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:331:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral20 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral21(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:447:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:343:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral21 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral22(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:449:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:355:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral22 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral23(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:451:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:367:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral23 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral24(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:453:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:379:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral24 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h: In instantiation of ‘void bilateral25(T**, T**, T**, int, int, double, bool) [with T = float; A = float]’:
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:455:69:   required from ‘void bilateral(T**, T**, T**, int, int, double, double, bool) [with T = float; A = float]’
/home/morgan/programs/code-rawtherapee/rtengine/ipsharpen.cc:189:145:   required from here
/home/morgan/programs/code-rawtherapee/rtengine/bilateral2.h:391:108: warning: unused parameter ‘multiThread’ [-Wunused-parameter]
 template<class T, class A> void bilateral25 (T** src, T** dst, T** buffer, int W, int H, double sens, bool multiThread)
                                                                                                            ^
Beep6581 commented 6 years ago

iptransform.cc

[  6%] Building CXX object rtengine/CMakeFiles/rtengine.dir/iptransform.cc.o
/home/morgan/programs/code-rawtherapee/rtengine/iptransform.cc: In member function ‘void rtengine::ImProcFunctions::transformGeneral(rtengine::ImProcFunctions::TransformMode, rtengine::Imagefloat*, rtengine::Imagefloat*, int, int, int, int, int, int, int, int, const rtengine::LensCorrection*)’:
/home/morgan/programs/code-rawtherapee/rtengine/iptransform.cc:793:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
                                ^
Beep6581 commented 6 years ago

stdimagesource.cc

[  5%] Building CXX object rtengine/CMakeFiles/rtengine.dir/stdimagesource.cc.o
/home/morgan/programs/code-rawtherapee/rtengine/stdimagesource.cc:190:154: warning: unused parameter ‘raw’ [-Wunused-parameter]
 void StdImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw)
                                                                                                                                                          ^
/home/morgan/programs/code-rawtherapee/rtengine/stdimagesource.cc:211:110: warning: unused parameter ‘wb’ [-Wunused-parameter]
 void StdImageSource::convertColorSpace(Imagefloat* image, const ColorManagementParams &cmp, const ColorTemp &wb)
                                                                                                              ^
Beep6581 commented 6 years ago

I also tested these files which weren't in the list above, with no issues found:

Floessie commented 6 years ago

@Beep6581

/home/morgan/programs/code-rawtherapee/rtengine/imagedata.cc:860:17: warning: missing initializer for member ‘tm::tm_sec’ [-Wmissing-field-initializers]
         return {};
                 ^

Those are false positives. AFAIK brace initializers in C++11 are guaranteed to zero-initialize.

Beep6581 commented 6 years ago

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55805