Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Hans-Peter Diettrich Newsgroups: comp.compilers Subject: Re: What is the meaning of an expression? Date: Wed, 19 Jan 2022 11:54:00 +0100 Organization: Compilers Central Lines: 25 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-01-069@comp.compilers> References: <22-01-052@comp.compilers> <22-01-060@comp.compilers> <22-01-066@comp.compilers> <22-01-067@comp.compilers> <22-01-068@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="26114"; mail-complaints-to="abuse@iecc.com" Keywords: optimize Posted-Date: 19 Jan 2022 10:13:33 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-01-068@comp.compilers> Content-Language: de-DE Xref: csiph.com comp.compilers:2842 On 1/19/22 12:18 AM, gah4 wrote: > So, back to anthropomorphic computers and logical > inconsistencies. How good are compilers, especially ones > that evaluate constant expressions at compile time, at > dealing with logic failure? Optimization is a special science. A compiler might evaluate a constant expression properly, in the sense that evaluation at runtime might fail due to overflows of too narrow types in compiled code. > And especially, as the question > needs, expressions that don't have a value? Aren't these called *statements*? Syntax does not normally allow for expressions without values, semantics disallow the use of subroutines without a return type as part of an expression. Expressions always have a value, but if that value is not used further then the compiler can ignore that part of the source code. Problems can arise from unrecognized side effects or exceptions eliminated by dead code elimination. DoDi