GNU bug report logs - #59992
[PATCH 1/2] tests: Fix 'type defaults' error in link_cond due to main not being properly declared

Previous Next

Package: automake-patches;

Reported by: Frederic Berat <fberat <at> redhat.com>

Date: Mon, 12 Dec 2022 08:44:04 UTC

Severity: wishlist

Tags: patch

Done: Mike Frysinger <vapier <at> gentoo.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59992 in the body.
You can then email your comments to 59992 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to automake-patches <at> gnu.org:
bug#59992; Package automake-patches. (Mon, 12 Dec 2022 08:44:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Frederic Berat <fberat <at> redhat.com>:
New bug report received and forwarded. Copy sent to automake-patches <at> gnu.org. (Mon, 12 Dec 2022 08:44:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Frederic Berat <fberat <at> redhat.com>
To: automake-patches <at> gnu.org
Cc: Frédéric Bérat <fberat <at> redhat.com>
Subject: [PATCH 1/2] tests: Fix 'type defaults' error in link_cond due to main
 not being properly declared
Date: Mon, 12 Dec 2022 08:05:53 +0100
From: Frédéric Bérat <fberat <at> redhat.com>

This is related to an effort to prepare Automake for future GCC/Clang
versions which set c99 as default standard to be used.
Not properly declaring main as "int main(...)" is rejected since c99.
---
 t/link_cond.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/link_cond.sh b/t/link_cond.sh
index e7a13b614..533e359e2 100644
--- a/t/link_cond.sh
+++ b/t/link_cond.sh
@@ -52,7 +52,7 @@ $AUTOCONF
 rm -f *.c++
 cat > less.c <<'END'
 /* Valid C but deliberately invalid C++ */
-main ()
+int main (void)
 {
   int new = 0;
   return new;
-- 
2.38.1





Information forwarded to automake-patches <at> gnu.org:
bug#59992; Package automake-patches. (Mon, 12 Dec 2022 20:15:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zack Weinberg <zack <at> owlfolio.org>
To: automake-patches <at> gnu.org
Subject: Re: [bug#59992] [PATCH 1/2] tests: Fix 'type defaults' error in
 link_cond due to main not being properly declared
Date: Mon, 12 Dec 2022 15:14:40 -0500
On 2022-12-12 2:05 AM, Frederic Berat wrote:
> This is related to an effort to prepare Automake for future GCC/Clang
> versions which set c99 as default standard to be used.
> Not properly declaring main as "int main(...)" is rejected since c99.
...
>   /* Valid C but deliberately invalid C++ */
> -main ()
> +int main (void)

Note the comment.  Is this test program still invalid C++ after your change?

zw





Information forwarded to automake-patches <at> gnu.org:
bug#59992; Package automake-patches. (Tue, 13 Dec 2022 08:03:04 GMT) Full text and rfc822 format available.

Message #11 received at 59992 <at> debbugs.gnu.org (full text, mbox):

From: Frederic Berat <fberat <at> redhat.com>
To: Zack Weinberg <zack <at> owlfolio.org>
Cc: 59992 <at> debbugs.gnu.org
Subject: Re: [bug#59992] [PATCH 1/2] tests: Fix 'type defaults' error in
 link_cond due to main not being properly declared
Date: Tue, 13 Dec 2022 07:35:23 +0100
On Mon, Dec 12, 2022 at 9:15 PM Zack Weinberg <zack <at> owlfolio.org> wrote:
>
> On 2022-12-12 2:05 AM, Frederic Berat wrote:
> > This is related to an effort to prepare Automake for future GCC/Clang
> > versions which set c99 as default standard to be used.
> > Not properly declaring main as "int main(...)" is rejected since c99.
> ...
> >   /* Valid C but deliberately invalid C++ */
> > -main ()
> > +int main (void)
>
> Note the comment.  Is this test program still invalid C++ after your change?

I assumed yes, since "new" should be a standard symbol, but I actually
forgot to double check.

>
> zw
>
>
>
>





Information forwarded to automake-patches <at> gnu.org:
bug#59992; Package automake-patches. (Thu, 15 Dec 2022 07:13:02 GMT) Full text and rfc822 format available.

Message #14 received at 59992 <at> debbugs.gnu.org (full text, mbox):

From: Frederic Berat <fberat <at> redhat.com>
To: Zack Weinberg <zack <at> owlfolio.org>
Cc: 59992 <at> debbugs.gnu.org
Subject: Re: [bug#59992] [PATCH 1/2] tests: Fix 'type defaults' error in
 link_cond due to main not being properly declared
Date: Thu, 15 Dec 2022 08:12:35 +0100
For the record:

cat > less.c <<'END'
/* Valid C but deliberately invalid C++ */
int main (void)
{
  int new = 0;
  return new;
}
END

$> g++ less.c
less.c: In function ‘int main()’:
less.c:4:7: error: expected unqualified-id before ‘new’
    4 |   int new = 0;
      |       ^~~
less.c:5:13: error: expected type-specifier before ‘;’ token
    5 |   return new;
      |             ^


On Tue, Dec 13, 2022 at 7:35 AM Frederic Berat <fberat <at> redhat.com> wrote:
>
> On Mon, Dec 12, 2022 at 9:15 PM Zack Weinberg <zack <at> owlfolio.org> wrote:
> >
> > On 2022-12-12 2:05 AM, Frederic Berat wrote:
> > > This is related to an effort to prepare Automake for future GCC/Clang
> > > versions which set c99 as default standard to be used.
> > > Not properly declaring main as "int main(...)" is rejected since c99.
> > ...
> > >   /* Valid C but deliberately invalid C++ */
> > > -main ()
> > > +int main (void)
> >
> > Note the comment.  Is this test program still invalid C++ after your change?
>
> I assumed yes, since "new" should be a standard symbol, but I actually
> forgot to double check.
>
> >
> > zw
> >
> >
> >
> >





Information forwarded to automake-patches <at> gnu.org:
bug#59992; Package automake-patches. (Thu, 15 Dec 2022 13:18:02 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Zack Weinberg" <zack <at> owlfolio.org>
To: automake-patches <at> gnu.org
Subject: Re: [bug#59992] [PATCH 1/2] tests: Fix 'type defaults' error in
 link_cond due to main not being properly declared
Date: Thu, 15 Dec 2022 08:16:54 -0500
On Thu, Dec 15, 2022, at 2:12 AM, Frederic Berat wrote:
> For the record:
>
> cat > less.c <<'END'
> /* Valid C but deliberately invalid C++ */
> int main (void)
> {
>   int new = 0;
>   return new;
> }
> END
>
> $> g++ less.c
> less.c: In function ‘int main()’:
> less.c:4:7: error: expected unqualified-id before ‘new’
>     4 |   int new = 0;
>       |       ^~~
> less.c:5:13: error: expected type-specifier before ‘;’ token
>     5 |   return new;
>       |             ^

Thanks, I haven't had time to look this up myself. Please go ahead and commit the patch.

zw




Information forwarded to automake-patches <at> gnu.org:
bug#59992; Package automake-patches. (Fri, 16 Dec 2022 06:19:03 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Frederic Berat <fberat <at> redhat.com>
To: automake-patches <at> gnu.org
Cc: Frédéric Bérat <fberat <at> redhat.com>
Subject: [PATCH v2 1/3] tests: Fix 'type defaults' error in link_cond due to
 main not being properly declared
Date: Fri, 16 Dec 2022 07:17:17 +0100
From: Frédéric Bérat <fberat <at> redhat.com>

No modifications from v1

-- 8< --

This is related to an effort to prepare Automake for future GCC/Clang
versions which set c99 as default standard to be used.
Not properly declaring main as "int main(...)" is rejected since c99.
---
 t/link_cond.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/link_cond.sh b/t/link_cond.sh
index e7a13b614..533e359e2 100644
--- a/t/link_cond.sh
+++ b/t/link_cond.sh
@@ -52,7 +52,7 @@ $AUTOCONF
 rm -f *.c++
 cat > less.c <<'END'
 /* Valid C but deliberately invalid C++ */
-main ()
+int main (void)
 {
   int new = 0;
   return new;
-- 
2.38.1





Information forwarded to automake-patches <at> gnu.org:
bug#59992; Package automake-patches. (Fri, 13 Jan 2023 06:34:02 GMT) Full text and rfc822 format available.

Message #23 received at 59992 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Frederic Berat <fberat <at> redhat.com>
Cc: 59992 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] tests: Fix 'type defaults' error in link_cond due to
 main not being properly declared
Date: Fri, 13 Jan 2023 06:33:12 +0000 (UTC)
thanks, merged now
-mike




Information forwarded to automake-patches <at> gnu.org:
bug#59992; Package automake-patches. (Fri, 13 Jan 2023 06:34:03 GMT) Full text and rfc822 format available.

Message #26 received at 59992 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Frederic Berat <fberat <at> redhat.com>
Cc: 59992 <at> debbugs.gnu.org, automake-patches <at> gnu.org
Subject: Re: [PATCH 1/2] tests: Fix 'type defaults' error in link_cond due to
 main not being properly declared
Date: Fri, 13 Jan 2023 06:33:30 +0000 (UTC)
severity 59992 wishlist
close 59992
thankyou




Severity set to 'wishlist' from 'normal' Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Fri, 13 Jan 2023 06:35:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 59992 <at> debbugs.gnu.org and Frederic Berat <fberat <at> redhat.com> Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Fri, 13 Jan 2023 06:35:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 10 Feb 2023 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 69 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.