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 643325 - [patch] Silence several warnings
[patch] Silence several warnings
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-25 19:25 UTC by Marc-Antoine Perennou
Modified: 2011-05-04 18:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Silence several warnings (3.48 KB, patch)
2011-02-25 19:25 UTC, Marc-Antoine Perennou
none Details | Review
Silence several warnings (13.82 KB, patch)
2011-02-28 09:33 UTC, Marc-Antoine Perennou
none Details | Review
Drop incorrect CXXFLAGS (1.06 KB, patch)
2011-03-04 16:50 UTC, Marc-Antoine Perennou
committed Details | Review
Remove an unused variable (889 bytes, patch)
2011-03-04 16:51 UTC, Marc-Antoine Perennou
committed Details | Review
Don't try to free a const char* (921 bytes, patch)
2011-03-04 16:51 UTC, Marc-Antoine Perennou
committed Details | Review
Drop the GJS_NATIVE_CONSTRUCTOR_VARIABLES macro (10.48 KB, patch)
2011-03-04 16:52 UTC, Marc-Antoine Perennou
rejected Details | Review
Don't ignore the return values of (f)write (1.81 KB, patch)
2011-03-04 16:53 UTC, Marc-Antoine Perennou
reviewed Details | Review
Make gjs_debugger_native_trap a JSFastNative (929 bytes, patch)
2011-03-04 16:54 UTC, Marc-Antoine Perennou
committed Details | Review

Description Marc-Antoine Perennou 2011-02-25 19:25:14 UTC
Currently, gjs compilation produces some warnings, most of them because of unused (f)write result or unused variables.
With this patch, only xulrunner2 headers warnings remain.
Comment 1 Marc-Antoine Perennou 2011-02-25 19:25:54 UTC
Created attachment 181942 [details] [review]
Silence several warnings
Comment 2 Marc-Antoine Perennou 2011-02-28 09:33:55 UTC
Created attachment 182071 [details] [review]
Silence several warnings

Drop the GJS_NATIVE_CONSTRUCTOR_VARIABLES macro and remove invalid CXXFLAGS
Comment 3 Colin Walters 2011-03-03 21:19:57 UTC
Review of attachment 182071 [details] [review]:

I'd like these as separate patches actually; it's easier to see what's going on.

::: util/crash.c
@@ +48,2 @@
     len = strlen(s);
+    int w G_GNUC_UNUSED = write(STDERR_FILENO, s, len);

No; we should keep repeating the write until it's done, not just ignore the return value.  (I typically create a function like "write_all" which does this).

@@ +63,2 @@
         while ((n = read(fd, buf, sizeof(buf))) > 0) {
+            w = write(STDERR_FILENO, buf, n);

Same here.
Comment 4 Marc-Antoine Perennou 2011-03-04 16:50:57 UTC
Created attachment 182493 [details] [review]
Drop incorrect CXXFLAGS
Comment 5 Marc-Antoine Perennou 2011-03-04 16:51:25 UTC
Created attachment 182494 [details] [review]
Remove an unused variable
Comment 6 Marc-Antoine Perennou 2011-03-04 16:51:52 UTC
Created attachment 182495 [details] [review]
Don't try to free a const char*
Comment 7 Marc-Antoine Perennou 2011-03-04 16:52:31 UTC
Created attachment 182496 [details] [review]
Drop the GJS_NATIVE_CONSTRUCTOR_VARIABLES macro
Comment 8 Marc-Antoine Perennou 2011-03-04 16:53:02 UTC
Created attachment 182497 [details] [review]
Don't ignore the return values of (f)write
Comment 9 Marc-Antoine Perennou 2011-03-04 16:54:52 UTC
Created attachment 182498 [details] [review]
Make gjs_debugger_native_trap a JSFastNative

Not really sure if this one needs a conditionnal test.
Does it create a warning with xulrunner 1.9.2 ?
Comment 10 Colin Walters 2011-03-10 21:19:22 UTC
Review of attachment 182497 [details] [review]:

::: util/crash.c
@@ +46,3 @@
+    /* keep writing until success */
+    while(write(STDERR_FILENO, s, len) < 0);
+}

Okay, not quite =)  In the case of an error, this will loop infinitely.

This part of the Unix API sucks honestly.  Rather than have you rediscover how to do it I'll just fix this myself.
Comment 11 Colin Walters 2011-03-10 22:25:03 UTC
Comment on attachment 182496 [details] [review]
Drop the GJS_NATIVE_CONSTRUCTOR_VARIABLES macro

I committed this but had to revert it, then fixed it a different way.
Comment 12 Colin Walters 2011-05-04 18:46:52 UTC
I think we got all of these committed.