Skip to content

Fix undefined behaviour in KStandardAction's create function

Aleix Pol Gonzalez requested to merge work/apol/fix-undefined-behaviour into master

.../include/KF5/KConfigWidgets/kstandardaction.h:261:64: runtime error: load of value 4294967295, which is not a valid value for type 'Qt::ConnectionType' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/apol/devel/kde5/include/KF5/KConfigWidgets/kstandardaction.h:261:64 in

Instead of inventing a -1 value for the default value, overload it so the default value is only taken when connectionType isn't passed. We get two functions which are more straightforward.

Merge request reports