From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D0043858D35; Sun, 6 Aug 2023 13:52:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D0043858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691329970; bh=lZ2ZX/VchwnWG20u3dh8QJTgxTZJkxqAcmao9V7gdMM=; h=From:To:Subject:Date:From; b=EaPBB+O6BNQXqDUVkLcRfBKhNHhYaiE0N2CqY1zVNt0FfyMBTNK1PUDrhq+z5v/Nf Jp7gmx+JMSuI3t5X9SfPYl2SdzeK7wqmGhqxVuS8XWHM1aeRG5eMp2RX+oE4vIsR8t pbIuVd70eVrWoMAElVSmOzNEBRe25jYjhKED7NUM= From: "muecker at gwdg dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110920] New: variably-length array declarations as parameters for C compatibility Date: Sun, 06 Aug 2023 13:52:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: muecker at gwdg dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110920 Bug ID: 110920 Summary: variably-length array declarations as parameters for C compatibility Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: muecker at gwdg dot de Target Milestone: --- g++ rejects variably length arrays in parameters because C++ does not have this. This is a problem when including some C headers. extern "C" { extern void foo(int A, double matrix[A]); extern void bar(int A, int B, double[A][B]); } g++ could simply parse and then ignore the parameter as a language extensio= n.=20 The first function 'foo' would then be directly usable form C++. For the se= cond function, there is no corresponding C++ type, but accepting this declaratio= n in headers would still allow the use of other functions. One could also consid= er=20 the possibility to allow calling this function from C++ code with a double*= .=