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 672725 - Fix some compiler warnings
Fix some compiler warnings
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
2.35.x
Other Linux
: Normal trivial
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-23 21:35 UTC by Felix Riemann
Modified: 2012-03-26 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove now unused or unneeded variables and functions (4.73 KB, patch)
2012-03-23 21:35 UTC, Felix Riemann
none Details | Review
Fix variables that could be accessed uninitialized (1.21 KB, patch)
2012-03-23 21:36 UTC, Felix Riemann
committed Details | Review
Add forgotten return value in error case (857 bytes, patch)
2012-03-23 21:36 UTC, Felix Riemann
committed Details | Review
Add some extra parentheses to fix GCC warnings (790 bytes, patch)
2012-03-23 21:37 UTC, Felix Riemann
none Details | Review

Description Felix Riemann 2012-03-23 21:35:26 UTC
Created attachment 210490 [details] [review]
Remove now unused or unneeded variables and functions

The current state in git master (2.35.90) produces quite a lot of compiler warnings here. The following patches address some of them.

In particular they don't fix warnings about pointer signedness when comparing xml strings against const chars as I don't see much sense in fixing them.
Comment 1 Felix Riemann 2012-03-23 21:36:10 UTC
Created attachment 210491 [details] [review]
Fix variables that could be accessed uninitialized

Fix warnings when building with -Wuninitialized.
---
 rsvg-base.c   |    2 +-
 rsvg-filter.c |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)
Comment 2 Felix Riemann 2012-03-23 21:36:56 UTC
Created attachment 210492 [details] [review]
Add forgotten return value in error case

Fix GCC warnings when using the -Wreturn-type parameter.
---
 rsvg-cairo-draw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Comment 3 Felix Riemann 2012-03-23 21:37:47 UTC
Created attachment 210493 [details] [review]
Add some extra parentheses to fix GCC warnings

These can occur when using the -Wparentheses parameter.
---
 rsvg-css.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Comment 4 Christian Persch 2012-03-25 12:22:14 UTC
Review of attachment 210491 [details] [review]:

::: rsvg-base.c
@@ +802,2 @@
     if (type == XML_EXTERNAL_PARAMETER_ENTITY && !content) {
+        guint8 *entity_data = NULL;

I'd rather add a catch-all |else entity_data = NULL;| on the if cascade below.
Comment 5 Christian Persch 2012-03-25 12:25:09 UTC
The first two patches are quite important; I'll ask r-t for approval to commit them (the 1st one with the change requested).
Comment 6 Christian Persch 2012-03-26 12:26:41 UTC
(In reply to comment #0)
> In particular they don't fix warnings about pointer signedness when comparing
> xml strings against const chars as I don't see much sense in fixing them.

I think it would be worth fixing them (just either use xmlStrcmp and cast the literal string to (const xmlChar*), or strcmp and cast the xml string to (const char*).