After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 663073 - gtk_dialog_new_with_buttons should be G_GNUC_NULL_TERMINATED
gtk_dialog_new_with_buttons should be G_GNUC_NULL_TERMINATED
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-10-31 01:41 UTC by Benjamin Moody
Modified: 2011-11-05 05:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix this issue (657 bytes, patch)
2011-11-02 04:54 UTC, Benjamin Moody
accepted-commit_now Details | Review
Mark gtk_dialog_new_with_buttons as NULL-terminated (1023 bytes, patch)
2011-11-05 05:27 UTC, Matthias Clasen
committed Details | Review

Description Benjamin Moody 2011-10-31 01:41:41 UTC
gtk_dialog_new_with_buttons() is a variable-argument function, where the end of the argument list is indicated by a NULL.  It should, therefore, be marked in the header file with the GCC "sentinel" attribute (G_GNUC_NULL_TERMINATED macro), so that the compiler can give a warning if the sentinel value is missing.
Comment 1 Matthias Clasen 2011-11-01 00:02:22 UTC
Sure, a patch to add that would be welcome.
Comment 2 Benjamin Moody 2011-11-02 04:54:05 UTC
Created attachment 200478 [details] [review]
patch to fix this issue

Here you go.
Comment 3 Matthias Clasen 2011-11-02 15:28:49 UTC
Review of attachment 200478 [details] [review]:

Looks good, thanks !
Comment 4 Matthias Clasen 2011-11-05 05:27:44 UTC
The following fix has been pushed:
8318515 Mark gtk_dialog_new_with_buttons as NULL-terminated
Comment 5 Matthias Clasen 2011-11-05 05:27:46 UTC
Created attachment 200737 [details] [review]
Mark gtk_dialog_new_with_buttons as NULL-terminated