From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1815 invoked by alias); 10 Aug 2010 22:33:49 -0000 Received: (qmail 1702 invoked by uid 48); 10 Aug 2010 22:33:32 -0000 Date: Tue, 10 Aug 2010 22:33:00 -0000 Message-ID: <20100810223332.1701.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/45249] Indirect variable parameters sometimes cause segmentation fault In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rogerio at rilhas dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-08/txt/msg00778.txt.bz2 ------- Comment #5 from rogerio at rilhas dot com 2010-08-10 22:33 ------- Are you sure this is the way to resolve this issue? I think this will make GCC an inferior product, as all other compilers I've tested produce correct results. As GCC sometimes produces correct code (and in such cases it works) I don't see anyway to get around the fact that this is, in fact, a bug. Additionally, I've sent you an example of how to compile it in a way that it works when compiled with GCC. Furthermore, I think most people would expect it to work as I'm passing the address of the original parameter. I've also shown the code for Windows where I can then use a va, but there doesn't seem to exist an equivalent for LINUX. Even if there were an equivalent this bug would affect its behaviour too, as I've checked the memory contents and the format string seems to have been copied and its original address on the stack is no longer preserved, which, of course, is wrong. If you still decide to discard this problem I will end up with no way to work around it and will have to definitively abandon LINUX as a software platform because of this shortcomming of GCC (which, I repeat, is not found on other compilers). Thanks, Rogerio -- rogerio at rilhas dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45249