Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some compilation warnings to check before release #6563

Closed
8 of 14 tasks
Thanatomanic opened this issue Aug 26, 2022 · 13 comments · Fixed by #7257
Closed
8 of 14 tasks

Some compilation warnings to check before release #6563

Thanatomanic opened this issue Aug 26, 2022 · 13 comments · Fixed by #7257
Labels
scope: compilation Compilation issues
Milestone

Comments

@Thanatomanic
Copy link
Contributor

Thanatomanic commented Aug 26, 2022

I did an extended warning build of dev on Windows and gcc 12.1 with -Wall -Wextra -Wdouble-promotion -Wno-unused-parameter -Wno-double-promotion to check for things that might be improved in the codebase before we ship 5.9. Could somebody (@Floessie ?) take a look at whether something can or should be done?

I ignored warnings from dcraw.cc and decoders (CR3, Panasonic).

  • In rtengine/imagedata.cc there are instances of uint16 that are deprecated. Probably needs <cstdint>'ifying.
  • In rtengine/imageio.cc there are instances of uint16 (and more) and uint32 that are deprecated. Probably needs <cstdint>'ifying.
  • In rtengine/imageio.cc something may be clobbered on line 1002:
C:/msys64/home/Roel/RawTherapee/rtengine/imageio.cc: In member function 'int rtengine::ImageIO::savePNG(const Glib::ustring&, int) const':
C:/msys64/home/Roel/RawTherapee/rtengine/imageio.cc:1002:56: warning: argument 'bps' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
 1002 | int ImageIO::savePNG  (const Glib::ustring &fname, int bps) const
      |                                                    ~~~~^~~
  • In rtengine/rtlensfun.cc this happens:
[108/298] Building CXX object rtengine/CMakeFiles/rtengine.dir/rtlensfun.cc.obj
C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc: In destructor 'virtual rtengine::LFModifier::~LFModifier()':
C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc:38:23: warning: 'void lfModifier::Destroy()' is deprecated [-Wdeprecated-declarations]
   38 |         data_->Destroy();
      |         ~~~~~~~~~~~~~~^~
In file included from C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.h:29,
                 from C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc:25:
C:/msys64/mingw64/include/lensfun/lensfun.h:2125:21: note: declared here
 2125 |     DEPRECATED void Destroy ();
      |                     ^~~~~~~
C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc: In static member function 'static bool rtengine::LFDatabase::init(const Glib::ustring&)':
C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc:321:41: warning: 'static lfDatabase* lfDatabase::Create()' is deprecated [-Wdeprecated-declarations]
  321 |     instance_.data_ = lfDatabase::Create();
      |                       ~~~~~~~~~~~~~~~~~~^~
C:/msys64/mingw64/include/lensfun/lensfun.h:1377:35: note: declared here
 1377 |     DEPRECATED static lfDatabase *Create ();
      |                                   ^~~~~~
C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc: In destructor 'rtengine::LFDatabase::~LFDatabase()':
C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc:395:23: warning: 'void lfDatabase::Destroy()' is deprecated [-Wdeprecated-declarations]
  395 |         data_->Destroy();
      |         ~~~~~~~~~~~~~~^~
C:/msys64/mingw64/include/lensfun/lensfun.h:1385:21: note: declared here
 1385 |     DEPRECATED void Destroy ();
      |                     ^~~~~~~
C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc: In member function 'std::unique_ptr<rtengine::LFModifier> rtengine::LFDatabase::getModifier(const rtengine::LFCamera&, const rtengine::LFLens&, float, float, float, int, int, bool) const':
C:/msys64/home/Roel/RawTherapee/rtengine/rtlensfun.cc:497:49: warning: 'static lfModifier* lfModifier::Create(const lfLens*, float, int, int)' is deprecated [-Wdeprecated-declarations]
  497 |             lfModifier *mod = lfModifier::Create(lens.data_, camera.getCropFactor(), width, height);
      |                               ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/mingw64/include/lensfun/lensfun.h:2068:35: note: declared here
 2068 |     DEPRECATED static lfModifier *Create (const lfLens *lens, float crop, int width, int height);
      |                                   ^~~~~~
  • In rtengine/rtthumbnail.cc there is a whole slew of [-Warray-bounds] warnings, similar to this one
In member function 'void rtengine::PlanarRGBData<T>::resizeImgTo(int, int, rtengine::TypeInterpolation, IC*) const [with IC = rtengine::Image8; T = float]',
    inlined from 'static IC* rtengine::Thumbnail::resizeTo(int, int, rtengine::TypeInterpolation, rtengine::ImageIO*) [with IC = rtengine::Image8]' at C:/msys64/home/Roel/RawTherapee/rtengine/rtthumbnail.h:162:40,
    inlined from 'static rtengine::Thumbnail* rtengine::Thumbnail::loadQuickFromRaw(const Glib::ustring&, rtengine::RawMetaDataLocation&, rtengine::eSensorType&, int&, int&, int, bool, bool, bool)' at C:/msys64/home/Roel/RawTherapee/rtengine/rtthumbnail.cc:490:42:
C:/msys64/home/Roel/RawTherapee/rtengine/iimage.h:868:13: warning: array subscript 0 is outside array bounds of 'void [224]' [-Warray-bounds]
  868 |         if (width == nw && height == nh) {
      |             ^~~~~
C:/msys64/home/Roel/RawTherapee/rtengine/rtthumbnail.cc: In static member function 'static rtengine::Thumbnail* rtengine::Thumbnail::loadQuickFromRaw(const Glib::ustring&, rtengine::RawMetaDataLocation&, rtengine::eSensorType&, int&, int&, int, bool, bool, bool)':
C:/msys64/home/Roel/RawTherapee/rtengine/rtthumbnail.cc:421:31: note: at offset -128 into object of size 224 allocated by 'operator new'
  421 |     Image8* img = new Image8 ();
      |                               ^
  • In rtgui/adjuster.cc it reports:
[129/298] Building CXX object rtgui/CMakeFiles/rth.dir/adjuster.cc.obj
In file included from C:/msys64/home/Roel/RawTherapee/rtgui/adjuster.h:22,
                 from C:/msys64/home/Roel/RawTherapee/rtgui/adjuster.cc:19:
C:/msys64/home/Roel/RawTherapee/rtgui/delayed.h: In instantiation of 'void delayed_helper::apply_impl(F, T, index_sequence<Is ...>) [with F = sigc::slot<void>; T = std::tuple<>; long long unsigned int ...Is = {}]':
C:/msys64/home/Roel/RawTherapee/rtgui/delayed.h:66:19:   required from 'void delayed_helper::apply(F, T) [with T = std::tuple<>; F = sigc::slot<void>]'
C:/msys64/home/Roel/RawTherapee/rtgui/delayed.h:218:30:   required from 'bool DelayedConnection<Ts>::onMinTimeout() [with Ts = {}]'
C:/msys64/home/Roel/RawTherapee/rtgui/delayed.h:208:75:   required from 'void DelayedConnection<Ts>::onSignal(Ts ...) [with Ts = {}]'
C:/msys64/home/Roel/RawTherapee/rtgui/delayed.h:165:60:   required from 'void DelayedConnection<Ts>::connect(Glib::SignalProxy<void, Ts ...>, const sigc::slot<void, Ts ...>&, const sigc::slot<void, Ts ...>&) [with Ts = {}]'
C:/msys64/home/Roel/RawTherapee/rtgui/adjuster.cc:156:23:   required from here
C:/msys64/home/Roel/RawTherapee/rtgui/delayed.h:58:28: warning: parameter 't' set but not used [-Wunused-but-set-parameter]
   58 |     void apply_impl(F f, T t, index_sequence<Is...>)
      |                          ~~^
  • In rtgui/main.cc there are calls to some deprecated GDK functions
[216/298] Building CXX object rtgui/CMakeFiles/rth.dir/main.cc.obj
C:/msys64/home/Roel/RawTherapee/rtgui/main.cc: In function 'int main(int, char**)':
C:/msys64/home/Roel/RawTherapee/rtgui/main.cc:546:36: warning: 'void gdk_threads_set_lock_functions(GCallback, GCallback)' is deprecated [-Wdeprecated-declarations]
  546 |     gdk_threads_set_lock_functions (G_CALLBACK (myGdkLockEnter), (G_CALLBACK (myGdkLockLeave)));
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/gtk-3.0/gdk/gdk.h:61,
                 from C:/msys64/mingw64/include/gdkmm-3.0/gdkmm/color.h:35,
                 from C:/msys64/mingw64/include/gdkmm-3.0/gdkmm/dragcontext.h:29,
                 from C:/msys64/mingw64/include/gtkmm-3.0/gtkmm.h:103,
                 from C:/msys64/home/Roel/RawTherapee/rtgui/main.cc:27:
C:/msys64/mingw64/include/gtk-3.0/gdk/gdkthreads.h:50:10: note: declared here
   50 | void     gdk_threads_set_lock_functions       (GCallback enter_fn,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/main.cc:547:21: warning: 'void gdk_threads_init()' is deprecated [-Wdeprecated-declarations]
  547 |     gdk_threads_init();
      |     ~~~~~~~~~~~~~~~~^~
C:/msys64/mingw64/include/gtk-3.0/gdk/gdkthreads.h:44:10: note: declared here
   44 | void     gdk_threads_init                     (void);
      |          ^~~~~~~~~~~~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/main.cc:564:30: warning: 'void gdk_threads_enter()' is deprecated [-Wdeprecated-declarations]
  564 |             gdk_threads_enter();
      |             ~~~~~~~~~~~~~~~~~^~
C:/msys64/mingw64/include/gtk-3.0/gdk/gdkthreads.h:46:10: note: declared here
   46 | void     gdk_threads_enter                    (void);
      |          ^~~~~~~~~~~~~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/main.cc:570:30: warning: 'void gdk_threads_leave()' is deprecated [-Wdeprecated-declarations]
  570 |             gdk_threads_leave();
      |             ~~~~~~~~~~~~~~~~~^~
C:/msys64/mingw64/include/gtk-3.0/gdk/gdkthreads.h:48:10: note: declared here
   48 | void     gdk_threads_leave                    (void);
      |          ^~~~~~~~~~~~~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/main.cc: In function 'int {anonymous}::processLineParams(int, char**)':
C:/msys64/home/Roel/RawTherapee/rtgui/main.cc:165:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
  165 |                     if (currParam == "-gimp") {
      |                     ^~
C:/msys64/home/Roel/RawTherapee/rtgui/main.cc:174:17: note: here
  174 |                 case 'h':
      |                 ^~~~
  • In rtgui/myflatcurve.cc there are potentially uninitialized variables prevCursorX and prevCursorY (line 1646)
  • In rtgui/options.cc there are these [-Wmissing-field-initializers] warnings:
[223/298] Building CXX object rtgui/CMakeFiles/rth.dir/options.cc.obj
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc: In member function 'void Options::setDefaults()':
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fShowExtensions' [-Wmissing-field-initializers]
  368 |     SHELLFLAGSTATE sft = { 0 };
      |                              ^
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fNoConfirmRecycle' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fShowSysFiles' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fShowCompColor' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fDoubleClickInWebView' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fDesktopHTML' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fWin95Classic' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fDontPrettyPath' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fShowAttribCol' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fMapNetDrvBtn' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fShowInfoTip' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fHideIcons' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fAutoCheckSelect' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fIconsOnly' [-Wmissing-field-initializers]
C:/msys64/home/Roel/RawTherapee/rtgui/options.cc:368:30: warning: missing initializer for member 'SHELLFLAGSTATE::fRestFlags' [-Wmissing-field-initializers]
  • In rtgui/rtimage.cc things could be made more explicit:
[252/298] Building CXX object rtgui/CMakeFiles/rth.dir/rtimage.cc.obj
C:/msys64/home/Roel/RawTherapee/rtgui/rtimage.cc: In copy constructor 'RTImage::RTImage(RTImage&)':
C:/msys64/home/Roel/RawTherapee/rtgui/rtimage.cc:41:1: warning: base class 'struct sigc::trackable' should be explicitly initialized in the copy constructor [-Wextra]
   41 | RTImage::RTImage (RTImage &other) : surface(other.surface), pixbuf(other.pixbuf)
      | ^~~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/rtimage.cc:41:1: warning: base class 'class Glib::ObjectBase' should be explicitly initialized in the copy constructor [-Wextra]
C:/msys64/home/Roel/RawTherapee/rtgui/rtimage.cc:41:1: warning: base class 'class Gtk::Image' should be explicitly initialized in the copy constructor [-Wextra]
  • In rtgui/rtscalable.cc it is suggested to use a replacement for a deprecated function call
[253/298] Building CXX object rtgui/CMakeFiles/rth.dir/rtscalable.cc.obj
C:/msys64/home/Roel/RawTherapee/rtgui/rtscalable.cc: In static member function 'static Cairo::RefPtr<Cairo::ImageSurface> RTScalable::loadImage(const Glib::ustring&, double)':
C:/msys64/home/Roel/RawTherapee/rtgui/rtscalable.cc:234:31: warning: 'void rsvg_handle_get_dimensions(RsvgHandle*, RsvgDimensionData*)' is deprecated: Use 'rsvg_handle_get_intrinsic_size_in_pixels' instead [-Wdeprecated-declarations]
  234 |     rsvg_handle_get_dimensions(handle, &dim);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from C:/msys64/home/Roel/RawTherapee/rtgui/rtscalable.cc:25:
C:/msys64/mingw64/include/librsvg-2.0/librsvg/rsvg.h:706:6: note: declared here
  706 | void rsvg_handle_get_dimensions (RsvgHandle *handle, RsvgDimensionData *dimension_data);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/rtscalable.cc:243:29: warning: 'gboolean rsvg_handle_render_cairo(RsvgHandle*, cairo_t*)' is deprecated: Use 'rsvg_handle_render_document' instead [-Wdeprecated-declarations]
  243 |     rsvg_handle_render_cairo(handle, c->cobj());
      |     ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/librsvg-2.0/librsvg/rsvg.h:1450:
C:/msys64/mingw64/include/librsvg-2.0/librsvg/rsvg-cairo.h:88:10: note: declared here
   88 | gboolean rsvg_handle_render_cairo (RsvgHandle *handle, cairo_t *cr);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/rtscalable.cc:244:21: warning: 'void rsvg_handle_free(RsvgHandle*)' is deprecated: Use 'g_object_unref' instead [-Wdeprecated-declarations]
  244 |     rsvg_handle_free(handle);
      |     ~~~~~~~~~~~~~~~~^~~~~~~~
C:/msys64/mingw64/include/librsvg-2.0/librsvg/rsvg.h:1232:6: note: declared here
 1232 | void rsvg_handle_free (RsvgHandle *handle);
      |      ^~~~~~~~~~~~~~~~
  • In rtgui/rtwindow.cc it is suggested to use a replacement for a deprecated function call
[255/298] Building CXX object rtgui/CMakeFiles/rth.dir/rtwindow.cc.obj
C:/msys64/home/Roel/RawTherapee/rtgui/rtwindow.cc: In member function 'void RTWindow::showRawPedia()':
C:/msys64/home/Roel/RawTherapee/rtgui/rtwindow.cc:934:17: warning: 'gboolean gtk_show_uri(GdkScreen*, const gchar*, guint32, GError**)' is deprecated: Use 'gtk_show_uri_on_window' instead [-Wdeprecated-declarations]
  934 |     gtk_show_uri(nullptr, "https://rawpedia.rawtherapee.com/", GDK_CURRENT_TIME, &gerror);
      |     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:200,
                 from C:/msys64/mingw64/include/gtkmm-3.0/gtkmm/enums.h:31,
                 from C:/msys64/mingw64/include/gtkmm-3.0/gtkmm/widget.h:47,
                 from C:/msys64/mingw64/include/gtkmm-3.0/gtkmm/action.h:31,
                 from C:/msys64/mingw64/include/gtkmm-3.0/gtkmm/toggleaction.h:29,
                 from C:/msys64/mingw64/include/gtkmm-3.0/gtkmm.h:108,
                 from C:/msys64/home/Roel/RawTherapee/rtgui/rtwindow.cc:20:
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkshow.h:33:10: note: declared here
   33 | gboolean gtk_show_uri  (GdkScreen   *screen,
      |          ^~~~~~~~~~~~
  • In rtgui/thumbbrowserbase.cc it is suggested to use a replacement for a deprecated function call
[272/298] Building CXX object rtgui/CMakeFiles/rth.dir/thumbbrowserbase.cc.obj
C:/msys64/home/Roel/RawTherapee/rtgui/thumbbrowserbase.cc: In member function 'virtual bool ThumbBrowserBase::Internal::on_button_press_event(GdkEventButton*)':
C:/msys64/home/Roel/RawTherapee/rtgui/thumbbrowserbase.cc:926:32: warning: 'void gdk_window_process_updates(GdkWindow*, gboolean)' is deprecated [-Wdeprecated-declarations]
  926 |     gdk_window_process_updates (window->gobj(), true);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/gtk-3.0/gdk/gdkseat.h:28,
                 from C:/msys64/mingw64/include/gtk-3.0/gdk/gdkdisplay.h:33,
                 from C:/msys64/mingw64/include/gtk-3.0/gdk/gdkscreen.h:32,
                 from C:/msys64/mingw64/include/gtk-3.0/gdk/gdkapplaunchcontext.h:31,
                 from C:/msys64/mingw64/include/gtk-3.0/gdk/gdk.h:32,
                 from C:/msys64/mingw64/include/gdkmm-3.0/gdkmm/color.h:35,
                 from C:/msys64/mingw64/include/gdkmm-3.0/gdkmm/dragcontext.h:29,
                 from C:/msys64/mingw64/include/gtkmm-3.0/gtkmm.h:103,
                 from C:/msys64/home/Roel/RawTherapee/rtgui/inspector.h:21,
                 from C:/msys64/home/Roel/RawTherapee/rtgui/thumbbrowserbase.cc:21:
C:/msys64/mingw64/include/gtk-3.0/gdk/gdkwindow.h:1069:12: note: declared here
 1069 | void       gdk_window_process_updates     (GdkWindow    *window,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
  • In rtgui/main-cli.cc there may be some unwanted implicit fallthrough
[291/298] Building CXX object rtgui/CMakeFiles/rth-cli.dir/main-cli.cc.obj
C:/msys64/home/Roel/RawTherapee/rtgui/main-cli.cc: In function 'int processLineParams(int, char**)':
C:/msys64/home/Roel/RawTherapee/rtgui/main-cli.cc:292:36: warning: this statement may fall through [-Wimplicit-fallthrough=]
  292 |                     copyParamsFile = true;
      |                     ~~~~~~~~~~~~~~~^~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/main-cli.cc:294:17: note: here
  294 |                 case 'o': // outputfile or dir
      |                 ^~~~
C:/msys64/home/Roel/RawTherapee/rtgui/main-cli.cc:343:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
  343 |                     skipIfNoSidecar = true;
      |                     ~~~~~~~~~~~~~~~~^~~~~~
C:/msys64/home/Roel/RawTherapee/rtgui/main-cli.cc:345:17: note: here
  345 |                 case 's': // Processing params next to file (file extension appended)
      |                 ^~~~
@Thanatomanic Thanatomanic added the scope: compilation Compilation issues label Aug 26, 2022
@Thanatomanic Thanatomanic added this to the v5.9 milestone Aug 26, 2022
Floessie added a commit that referenced this issue Aug 26, 2022
@Floessie
Copy link
Collaborator

@Thanatomanic I've pushed a new branch to fix some low hanging fruits. Though I don't get no deprecation warnings here.

As to rtgui/rtimage.cc: I added the Gtk::Image(), but this doesn't solve the warning.

-Warray-bounds seems to be the source of many false positives, and I don't see how we can fix it. The warnings are new with GCC 12, as far as I remember.

rtgui/adjuster.cc: This seems to be a wrong warning when T is void. Sure void t isn't used...

Feel free to add your fixes to the branch, everyone.

Best,
Flössie

@Pandagrapher
Copy link
Collaborator

@Thanatomanic @Floessie
For rtgui/rtscalable.cc:
For RT 6.0, I am currently working on native/"real" hidpi support. I have updated these deprecated librsvg functions by the new ones. Refer to this branch if you want to correct these warnings for RT 5.9

Pierre

@Lawrence37
Copy link
Collaborator

The lensfun deprecation warnings can be ignored for now. They are deprecated since the current stable version (0.3.3). Some replacements have only been added in 0.3.2 and the rest in 0.3.3. I suppose we could fix some warnings and bump the minimum required version to 0.3.2, which is almost 7 years old.

Lawrence37 added a commit that referenced this issue Sep 6, 2022
@Lawrence37
Copy link
Collaborator

I pushed some warning fixes to @Floessie's branch.

  • Deprecated types in rtengine/imagedata.cc and rtengine/imageio.cc
  • Uninitialized variables in rtgui/myflatcurve.cc
  • Explicit copy constructor initialization of base classes in rtgui/rtimage.cc

Removing the deprecated GDK functions could break some things that are not trivial to fix. Let's leave them for 5.9.

@Floessie
Copy link
Collaborator

Floessie commented Sep 6, 2022

@Lawrence37 Thanks for picking this up! Two points:

  • If including <cstdint> IMHO it's cleaner to use std::uint*_t.
  • Gtk::Image is derived from sigc::trackable() and Glib::ObjectBase(). AFAIK base classes are implicitly copy-constructed, that's why even adding Gtk::Image to the list was "too much". Is the warning wrong or am I missing something?

Best,
Flössie

@Lawrence37
Copy link
Collaborator

@Floessie I've added std:: to the types. The copy constructor warning I think is there to enforce "good practice" of explicitly calling the base class constructors.

@Lawrence37
Copy link
Collaborator

I pushed one more change which replaces the deprecated function rsvg_handle_free. There is one more warning I feel can be addressed. Someone on Windows could try replacing SHELLFLAGSTATE sft = { 0 } with SHELLFLAGSTATE sft = { }.

The remaining deprecated functions can stay for now.

  • rsvg_handle_get_intrinsic_size_in_pixels was introduced in librsvg version 2.52. rsvg_handle_render_document was introduced in 2.46. The current minimum required version in CMakeLists.txt is 2.40.
  • gtk_show_uri_on_window was introduced in GTK 3.22 and is not in GTK 4. The minimum required version is 3.16 for Linux and MacOS.
  • gdk_window_process_updates has no replacement and I'm not sure what magic this function call does.

@Beep6581
Copy link
Collaborator

For RT 6.0, I am currently working on native/"real" hidpi support.

@Pandagrapher as it's been a few years since I dealt with the joy called HiDPI, and since I now actually have a HiDPI monitor, could you link me to some documentation on what "real" HiDPI support means and how to go about implementing it? Also, which version of Gtk+ will be required for that? Sorry for the off-topic - if there is an issue dedicated to that, feel free to reply there and tag me.

@mattiaverga
Copy link
Contributor

I did a build of dev for Fedora Rawhide and gcc 12.2, you might be interested in some more warnings (full log here:

  • in rtengine/xtrans_demosaic.cc:
/builddir/build/BUILD/RawTherapee-4059ae5bcad8e18443bf8f37bcff84de1dcc0d03/rtengine/procparams.cc: In member function 'rtengine::procparams::ProcParams::save(Glib::ustring const&, Glib::ustring const&, bool, ParamsEdited*)':
/builddir/build/BUILD/RawTherapee-4059ae5bcad8e18443bf8f37bcff84de1dcc0d03/rtengine/procparams.cc:5877:5: note: variable tracking size limit exceeded with '-fvar-tracking-assignments', retrying without
 5877 | int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bool fnameAbsolute, ParamsEdited* pedited)
      |     ^~~~~~~~~~
/builddir/build/BUILD/RawTherapee-4059ae5bcad8e18443bf8f37bcff84de1dcc0d03/rtengine/procparams.cc: In member function 'rtengine::procparams::ProcParams::load(Glib::ustring const&, ParamsEdited*)':
/builddir/build/BUILD/RawTherapee-4059ae5bcad8e18443bf8f37bcff84de1dcc0d03/rtengine/procparams.cc:7607:5: note: variable tracking size limit exceeded with '-fvar-tracking-assignments', retrying without
 7607 | int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
      |     ^~~~~~~~~~
  • In rtgui/paramsedited.cc and rtgui/multilangmgr.cc:
In file included from /usr/include/c++/12/string:40,
                 from /builddir/build/BUILD/RawTherapee-4059ae5bcad8e18443bf8f37bcff84de1dcc0d03/rtgui/multilangmgr.h:22,
                 from /builddir/build/BUILD/RawTherapee-4059ae5bcad8e18443bf8f37bcff84de1dcc0d03/rtgui/multilangmgr.cc:19:
In function 'std::char_traits<char>::copy(char*, char const*, unsigned long)',
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy(char*, char const*, unsigned long)' at /usr/include/c++/12/bits/basic_string.h:423:21,
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy(char*, char const*, unsigned long)' at /usr/include/c++/12/bits/basic_string.h:418:7,
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)' at /usr/include/c++/12/bits/basic_string.tcc:532:22,
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)' at /usr/include/c++/12/bits/basic_string.h:2171:19,
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*)' at /usr/include/c++/12/bits/basic_string.h:2196:22,
    inlined from 'MultiLangMgr::load(Glib::ustring const&, std::vector<Glib::ustring, std::allocator<Glib::ustring> > const&)' at /builddir/build/BUILD/RawTherapee-4059ae5bcad8e18443bf8f37bcff84de1dcc0d03/rtgui/multilangmgr.cc:202:35:
/usr/include/c++/12/bits/char_traits.h:431:56: warning: 'memcpy' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
  431 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

@Beep6581
Copy link
Collaborator

Beep6581 commented Oct 5, 2022

At this point I think its best to leave this for 6.0.

@Beep6581 Beep6581 modified the milestones: v5.9, v6.0 Nov 29, 2022
@Christian-Kr
Copy link
Contributor

Hello to everyone here,

is anyone currently working on removing gdk_threads_enter() (one warning message above). I don't have a lot of experience in GDK/GTK and its thread handling. But if no one is working on that, I will give it a try.

Thank you in advance.

Greetings

@Lawrence37
Copy link
Collaborator

There are a few new warnings, but not from new code. See #6621 (comment).

@Lawrence37
Copy link
Collaborator

I fixed the remaining warnings, minus the ones we agree to ignore, in #7257. It builds and runs fine in Windows and Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: compilation Compilation issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants