Unused variables warning with -Wextra flag

Iain Buclaw ibuclaw at ubuntu.com
Thu Feb 28 13:45:01 PST 2013


On Feb 28, 2013 6:55 PM, "bdsatish" <bdsatish at gmail.com> wrote:
>
> Hi,
>
> Some warning messages are being "leaked" from GDC's source code into
end-user's code. I think this shouldn't happen and hence, is a bug.
>
> ```
> // example.d
> import std.string;
>
> void main()
> {
>   format("Hello World");
> }
>
> ```
> Here's the output:
>
> ```
> [shell]$ gdc -Wextra example.d
> $INSTALLDIR/gcc/include/d/4.8.0/std/utf.d: In function 'decode':
> $INSTALLDIR/gcc/include/d/4.8.0/std/utf.d:856: warning: uninitialized
variable 'result'
> $INSTALLDIR/gcc/include/d/4.8.0/std/utf.d: In function 'decode':
> $INSTALLDIR/gcc/include/d/4.8.0/std/utf.d:856: warning: uninitialized
variable 'result'
> $INSTALLDIR/gcc/include/d/4.8.0/std/utf.d: In function 'decode':
> $INSTALLDIR/gcc/include/d/4.8.0/std/utf.d:856: warning: uninitialized
variable 'result'
> example.d: In function 'std.format.formattedWrite!(Appender!(string),
char, ).formattedWrite':
> $INSTALLDIR/gcc/include/d/4.8.0/std/format.d:504: warning: 'iftmp.16' may
be used uninitialized in this function
> $INSTALLDIR/gcc/include/d/4.8.0/std/format.d:504: warning: 'iftmp.17' may
be used uninitialized in this function
> ```
>
> So, all these warnings seem to be from GDC. Is there a way to supress
these warnings? (for GDC's libs, not my own code).
>
>
> --Satish

The iftmp's shouldn't be emitted, the others though are because it's a
template instantiated into the module you are compiling.

Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20130228/3f4b7c27/attachment.html>


More information about the D.gnu mailing list