Does the compiler warn with
void U_WMRCORE_SIZE16_swap(char *record, int /*torev*/){
as well? I've seen this several times.
Regards, Markus
-----Ursprüngliche Nachricht----- Von: mathog [mailto:mathog@...1176...] Gesendet: Dienstag, 25. März 2014 00:20 An: su_v Cc: Inkscape Devel Betreff: Re: [Inkscape-devel] Warnings check
On 22-Mar-2014 06:16, su_v wrote:
-Wno-error=self-assign
more errors:
../../src/libuemf/uwmf_endian.c:285:10: error: explicitly assigning a variable of type 'int' to itself [-Werror,-Wself-assign]
Sometimes you can't win.
The line with the warning is the second one below:
void U_WMRCORE_SIZE16_swap(char *record, int torev){ torev = torev; // shuts up compiler warnings about unused parameters U_swap4(record, 1); /* Size16_4 is at offset 0 in U_METARECORD */ }
where this is one of those situations where there are a large number of functions all use the same argument list, but some of them don't actually use some of the arguments. The
torev = torev
trick is one way to silence the "unused argument" warning in gcc and last time I checked it worked for several other compilers as well, like Sun's compiler. Apparently not for clang though. Note this is in a C module, so the C++ syntax to indicate an unused argument will not work. AFAIK the C language specification provides no standard way to eliminate this warning or its evil twin "statement with no effect", which is what you get if you try to finesse this situation with:
(void) torev;
Note, the other similar clang warnings are all for the same thing.
Regards,
David Mathog mathog@...1176... Manager, Sequence Analysis Facility, Biology Division, Caltech
---------------------------------------------------------------------------- -- Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel