in reply to Re^3: porting C code to Perl
in thread porting C code to Perl
However it doesn't matter, because the '= 0' doesn't actually add anything.
From testing, it seems to matter on the Mac platform including CentOS 7.3. I compared the output with this site. No warnings are emitted on CentOS 7.3.
Without '= 0'
predigit, nines = 0; -- Mac OS X, Apple LLVM version 7.3.0 (clang-703.0.31) demo.c:41:13: warning: expression result unused [-Wunused-value] predigit, nines = 0; ^~~~~~~~ 1 warning generated. 0314159265358979323846264338327954288419716939937510582097494459230781 +6406286208998628734825342117067 | + | 4 + 7 -- Linux, gcc version 4.8.5 20150623 0314159265358979323846264338327954288419716939937510582097494459230781 +6406286208998628734825342117067 | + | 4 + 7
With '= 0'
predigit = 0, nines = 0; 0314159265358979323846264338327950288419716939937510582097494459230781 +6406286208998628034825342117067 | + | 0 + 0
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: porting C code to Perl
by Monk::Thomas (Friar) on Oct 24, 2017 at 15:38 UTC | |
by RonW (Parson) on Oct 25, 2017 at 20:47 UTC | |
by marioroy (Prior) on Oct 24, 2017 at 15:57 UTC | |
by Anonymous Monk on Oct 24, 2017 at 17:53 UTC | |
Re^5: porting C code to Perl
by danaj (Friar) on Oct 26, 2017 at 01:56 UTC |