Re: [Python-checkins] CVS: python/dist/src/Modules _sre.c,2.63,2.64

sjoerd wrote:
Modified Files: _sre.c Log Message: Removed unreachable return to silence SGI compiler.
! /* shouldn't end up here */ ! return SRE_ERROR_ILLEGAL; }
--- 1141,1145 ---- }
! /* can't end up here */ }
I hate stuff like this: that line was there to make sure *I* don't mess up when developing SRE, not to deal with potentially broken compilers or misfired electrons. isn't there any way to tell the SGI compiler to stop whining about this? </F>

_sre.c Log Message: Removed unreachable return to silence SGI compiler.
! /* shouldn't end up here */ ! return SRE_ERROR_ILLEGAL; }
--- 1141,1145 ---- }
! /* can't end up here */ }
[Fredrik Lundh]
I hate stuff like this: that line was there to make sure *I* don't mess up when developing SRE, not to deal with potentially broken compilers or misfired electrons.
isn't there any way to tell the SGI compiler to stop whining about this?
I've had better luck x-platform with, e.g., assert(!"can't get here"); /* !string is always false */ In non-debug builds, it vanishes so there's nothing for the compiler to gripe about; while in debug builds most compilers don't do enough flow analysis to realize there *is* something to gripe about. Overall, it would be more useful if SGI compilers in particular produced: C00666: Warning: -O may produce buggy code. after every executable line <wink>.

Well, there is the possibility to add -woff 1110 to the compiler command line. However, I don't agree that this is whining and I wouldn't like to see any warnings suppressed like this. Warnings signal a potential bug, any so does this one. If the flow of control did reach this particular line, the compiler would also give a warning, namely that the function has both return value and return void (or words to that effect). I use the compiler in non-debug mode (-g option, no -O option), and I do get these warnings, so some compilers do do enough flow control in non-debug mode. On Thu, Aug 30 2001 "Tim Peters" wrote:
_sre.c Log Message: Removed unreachable return to silence SGI compiler.
! /* shouldn't end up here */ ! return SRE_ERROR_ILLEGAL; }
--- 1141,1145 ---- }
! /* can't end up here */ }
[Fredrik Lundh]
I hate stuff like this: that line was there to make sure *I* don't mess up when developing SRE, not to deal with potentially broken compilers or misfired electrons.
isn't there any way to tell the SGI compiler to stop whining about this?
I've had better luck x-platform with, e.g.,
assert(!"can't get here"); /* !string is always false */
In non-debug builds, it vanishes so there's nothing for the compiler to gripe about; while in debug builds most compilers don't do enough flow analysis to realize there *is* something to gripe about.
Overall, it would be more useful if SGI compilers in particular produced:
C00666: Warning: -O may produce buggy code.
after every executable line <wink>.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev
-- Sjoerd Mullender <sjoerd.mullender@oratrix.com>

On Fri, Aug 31, 2001 at 11:08:19AM +0200, Sjoerd Mullender wrote:
any so does this one. If the flow of control did reach this particular line, the compiler would also give a warning, namely that the function has both return value and return void (or words to that effect).
Your compiler might, but I don't know if Fredrik's will, and for the SRE code Fredrik's compiler is more important. Perhaps Tim's suggested assert() can fix things so that both of you are happy. --amk
participants (4)
-
Andrew Kuchling
-
Fredrik Lundh
-
Sjoerd Mullender
-
Tim Peters