This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/456: constant expressions constraints
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/456: constant expressions constraints
- From: Joseph Myers <jsm28 at cam dot ac dot uk>
- Date: Wed, 09 Aug 2000 01:22:08 +0000
- Cc: jsm28 at cam dot ac dot uk
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, Joseph Myers <jsm28@cam.ac.uk>
>Number: 456
>Category: c
>Synopsis: constant expressions constraints
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Tue Aug 08 18:26:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Joseph S. Myers
>Release: 2.96
>Organization:
none
>Environment:
System: Linux decomino 2.2.16 #1 Thu Jun 8 00:26:22 UTC 2000 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
>Description:
GCC fails to diagnose violations of the constraints for constant
expressions, in -std=c89 -pedantic mode, in some cases where they
appear in unevaluated parts of the expression (although it does
diagnose them when evaluated, even if they are accepted as extensions
without -pedantic). According to the 1990 standard, they must be
diagnosed unless they appear inside sizeof. (C99 changes this to "a
subexpression that is not evaluated", but there are still
restrictions, albeit in Semantics rather than Constraints and so not
requiring diagnostics, on the operands of such expressions.)
>How-To-Repeat:
See gcc.dg/c90-const-expr-1.c .
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: