#1336 closed Bug (fixed)
complation warnings
Reported by: | smmalis | Owned by: | charles |
---|---|---|---|
Priority: | Normal | Milestone: | 1.40 |
Component: | Transmission | Version: | 1.34 |
Severity: | Normal | Keywords: | |
Cc: |
Description
I get the following warnings while compiling. Warnings aren't necessarily a problem, but I felt you should be aware. It seems that not all of them are Transmission's fault.
steven@steven-desktop:~/Scripts/Transmission$ make | grep warning evdns.c:77:1: warning: "_FORTIFY_SOURCE" redefined <command-line>: warning: this is the location of the previous definition Reading "./regress.rpc" Created struct: msg Added entry: from_name Added entry: to_name Added entry: attack Added entry: run Created struct: kill Added entry: weapon Added entry: action Added entry: how_often Created struct: run Added entry: how Added entry: some_bytes Added entry: fixed_bytes ... creating "./regress.gen.h" ... creating "./regress.gen.c" test-eof.c: In function ‘main’: test-eof.c:67: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result regress.c: In function ‘test_simpleread’: regress.c:314: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result regress.c: In function ‘test_fork’: regress.c:478: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result regress.c:509: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result regress.c:522: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result regress.c: In function ‘test_event_base_new’: regress.c:792: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result regress.c: In function ‘test_multiple_events_for_same_fd’: regress.c:1195: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result regress.c: In function ‘read_once_cb’: regress.c:1221: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result regress.c: In function ‘test_want_only_once’: regress.c:1237: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result bench.c: In function ‘read_cb’: bench.c:78: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result bench.c: In function ‘run_once’: bench.c:102: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result natpmp.c:83: warning: no previous prototype for ‘sendpendingrequest’ natpmp.c:99: warning: no previous prototype for ‘sendnatpmprequest’ natpmp.c:164: warning: no previous prototype for ‘readnatpmpresponse’ miniupnpc.c:622: warning: no previous prototype for ‘UPNPIGD_IsConnected’ miniwget.c: In function ‘miniwget2’: miniwget.c:37: warning: unused parameter ‘url’ miniwget.c: At top level: miniwget.c:158: warning: no previous prototype for ‘parseURL’ miniwget.c:194: warning: no previous prototype for ‘miniwget’ miniwget.c:206: warning: no previous prototype for ‘miniwget_getaddr’ minixml.c:38: warning: no previous prototype for ‘parseatt’ minixml.c:109: warning: no previous prototype for ‘parseelt’ makemeta.c: In function ‘getHashInfo’: makemeta.c:241: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result peer-msgs.c: In function ‘myDebug’: peer-msgs.c:381: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result trevent.c: In function ‘logFunc’: trevent.c:140: warning: format not a string literal and no format arguments trevent.c:142: warning: format not a string literal and no format arguments trevent.c: In function ‘tr_eventInit’: trevent.c:181: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result trevent.c: In function ‘tr_timerNew’: trevent.c:271: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result trevent.c:272: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result trevent.c: In function ‘tr_runInEventThread’: trevent.c:296: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result trevent.c:299: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result utils.c: In function ‘tr_deepLog’: utils.c:207: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result In function ‘memset’, inlined from ‘tr_malloc0’ at utils.c:636: /usr/include/bits/string3.h:82: warning: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters In function ‘memset’, inlined from ‘tr_malloc0’ at utils.c:636, inlined from ‘tr_base64_decode’ at utils.c:1178: /usr/include/bits/string3.h:82: warning: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters In function ‘memset’, inlined from ‘tr_malloc0’ at utils.c:636, inlined from ‘tr_bitfieldNew’ at utils.c:696: /usr/include/bits/string3.h:82: warning: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters ./libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters ./libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters ./libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters ./libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters ./libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters ./libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters ./libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters ./libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters blocklist.c: In function ‘blocklistThreadFunc’: blocklist.c:134: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result dialogs.c: In function ‘confirmRemove’: dialogs.c:253: warning: format not a string literal and no format arguments main.c: In function ‘flushAddTorrentErrors’: main.c:1002: warning: format not a string literal and no format arguments main.c:1003: warning: format not a string literal and no format arguments sexy-marshal.c:52: warning: no previous prototype for ‘sexy_marshal_BOOLEAN__STRING’ sexy-marshal.c:91: warning: no previous prototype for ‘sexy_marshal_OBJECT__OBJECT_OBJECT’ sexy-marshal.c:132: warning: no previous prototype for ‘sexy_marshal_VOID__INT_INT’ tr-prefs.c: In function ‘onBlocklistStatus’: tr-prefs.c:462: warning: format not a string literal and no format arguments util.c: In function ‘addTorrentErrorDialog’: util.c:398: warning: format not a string literal and no format arguments ../libtransmission/libtransmission.a(utils.o): In function `memset': /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters /usr/include/bits/string3.h:82: warning: memset used with constant zero length parameter; this could be due to transposed parameters
Attachments (1)
Change History (15)
comment:1 Changed 12 years ago by charles
- Component changed from GTK+ Client to Transmission
- Milestone changed from None Set to 1.40
- Status changed from new to assigned
comment:2 Changed 12 years ago by charles
- Resolution set to fixed
- Status changed from assigned to closed
comment:3 Changed 12 years ago by charles
One side note, I didn't do anything to the memset calls. I don't see the error there... what compiler flag were you using to generate that warning?
comment:4 Changed 12 years ago by smmalis
Whatever compiler flags make uses. You can see the command I ran at the top.
comment:5 Changed 12 years ago by charles
no I can't. all I see is "make | grep warning", so you've grepped out the lines where gcc is actually being invoked.
comment:6 Changed 12 years ago by smmalis
Oh I get you now. Complete output of make coming up.
Changed 12 years ago by smmalis
comment:7 Changed 12 years ago by smmalis
Just noticed that there still are a few warnings.
comment:8 Changed 12 years ago by charles
memset errors fixed in r6877.
comment:9 Changed 12 years ago by smmalis
- Resolution fixed deleted
- Status changed from closed to reopened
Three left, I assume the warn_unused_results are intentional.
sexy-marshal.c:52: warning: no previous prototype for ‘sexy_marshal_BOOLEAN__STRING’ sexy-marshal.c:91: warning: no previous prototype for ‘sexy_marshal_OBJECT__OBJECT_OBJECT’ sexy-marshal.c:132: warning: no previous prototype for ‘sexy_marshal_VOID__INT_INT’
comment:10 Changed 12 years ago by charles
- Resolution set to fixed
- Status changed from reopened to closed
I can't do anything about those; sexy-marshal.c is autogenerated by glib-genmarshal. You might want to submit a bug report against glib @ bugzilla.gnome.org.
comment:11 Changed 12 years ago by charles
actually there's already a ticket there, with a suggested solution.
comment:12 Changed 12 years ago by charles
that part's fixed in r6879 now.
comment:13 Changed 12 years ago by charles
as an aside... I had to dig through about six layers of calls to figure out what gcc was warning about at compile time. gcc is getting pretty sophisticated. :)
what version of gcc do you have installed?
comment:14 Changed 12 years ago by smmalis
looks like 4.3.2
Telling me what compiler flags you used when compiling would've been helpful.
I've fixed the ones in libtransmission and gtk+ in r6873. The format argument is particularly helpful; thanks.
libevent warnings should be reported upstream to the libevent developers.
miniupnp and libnatpmp warnings should be reported upstream to the miniupnp/libnatpmp developers.