From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10282 invoked by alias); 19 Apr 2003 00:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10256 invoked by uid 71); 19 Apr 2003 00:26:00 -0000 Resent-Date: 19 Apr 2003 00:26:00 -0000 Resent-Message-ID: <20030419002600.10255.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, bero@arklinux.org Received: (qmail 9122 invoked by uid 48); 19 Apr 2003 00:21:14 -0000 Message-Id: <20030419002114.9121.qmail@sources.redhat.com> Date: Sat, 19 Apr 2003 00:26:00 -0000 From: bero@arklinux.org Reply-To: bero@arklinux.org To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/10436: Taking address of casted value gives error X-SW-Source: 2003-04/txt/msg00852.txt.bz2 List-Id: >Number: 10436 >Category: c >Synopsis: Taking address of casted value gives error >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Sat Apr 19 00:26:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Bernhard Rosenkraenzer >Release: gcc 3.3 branch as of 2003/04/15 >Organization: >Environment: Ark Linux Dockyard (Linux 2.4.20, glibc 2.3.2) >Description: The following simple code: int test(void **tmp) { } int main(int argc, char **argv) { char *a="Test"; test(&(void*)a); } gives: test.c: In function `main': test.c:6: error: invalid lvalue in unary `&' This slightly longer, but equivalent variant works: int test(void **tmp) { } int main(int argc, char **argv) { char *a="Test"; void *b=(void*)a; test(&b); } Problem occurs with both the C and C++ front ends. >How-To-Repeat: Try to compile the sample code. >Fix: >Release-Note: >Audit-Trail: >Unformatted: