public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] modula-2, libm2min: Declare abort and exit as expected.
@ 2023-01-07 15:45 Iain Sandoe
  2023-01-07 17:34 ` Gaius Mulley
  0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2023-01-07 15:45 UTC (permalink / raw)
  To: gcc-patches; +Cc: gaiusmod2

Tested with a build on x86_64-darwin21, the build warnings are gone and
the build completed as normal.
OK for master?
thanks
Iain

--- 8< ---

The build is currently emitting a warning that abort() is declared differently
from the built-in.  This updates the declaration to match expectations.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/m2/ChangeLog:

	* gm2-libs-min/libc.c (abort): Update declaration to match the
	expected form, add no-return attribute.
	(exit): Add no-return attribute.
---
 gcc/m2/gm2-libs-min/libc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/m2/gm2-libs-min/libc.c b/gcc/m2/gm2-libs-min/libc.c
index b39bfffb65c..8cddb5dd7b4 100644
--- a/gcc/m2/gm2-libs-min/libc.c
+++ b/gcc/m2/gm2-libs-min/libc.c
@@ -24,10 +24,10 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-void abort (int);
-void exit (int);
+extern void abort (void)  __attribute__ ((__noreturn__));
+extern void exit (int) __attribute__ ((__noreturn__));
 
-void abort (int i)
+void abort (void)
 {
   while (1)
     ;
-- 
2.37.1 (Apple Git-137.1)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] modula-2, libm2min: Declare abort and exit as expected.
  2023-01-07 15:45 [PATCH] modula-2, libm2min: Declare abort and exit as expected Iain Sandoe
@ 2023-01-07 17:34 ` Gaius Mulley
  0 siblings, 0 replies; 2+ messages in thread
From: Gaius Mulley @ 2023-01-07 17:34 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: gcc-patches, iain

Iain Sandoe <iains.gcc@gmail.com> writes:

> Tested with a build on x86_64-darwin21, the build warnings are gone and
> the build completed as normal.
> OK for master?
> thanks
> Iain
>
> --- 8< ---
>
> The build is currently emitting a warning that abort() is declared differently
> from the built-in.  This updates the declaration to match expectations.
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
>
> gcc/m2/ChangeLog:
>
> 	* gm2-libs-min/libc.c (abort): Update declaration to match the
> 	expected form, add no-return attribute.
> 	(exit): Add no-return attribute.
> ---
>  gcc/m2/gm2-libs-min/libc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/m2/gm2-libs-min/libc.c b/gcc/m2/gm2-libs-min/libc.c
> index b39bfffb65c..8cddb5dd7b4 100644
> --- a/gcc/m2/gm2-libs-min/libc.c
> +++ b/gcc/m2/gm2-libs-min/libc.c
> @@ -24,10 +24,10 @@ a copy of the GCC Runtime Library Exception along with this program;
>  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  <http://www.gnu.org/licenses/>.  */
>  
> -void abort (int);
> -void exit (int);
> +extern void abort (void)  __attribute__ ((__noreturn__));
> +extern void exit (int) __attribute__ ((__noreturn__));
>  
> -void abort (int i)
> +void abort (void)
>  {
>    while (1)
>      ;

yes LGTM, thanks!

regards,
Gaius

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-07 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-07 15:45 [PATCH] modula-2, libm2min: Declare abort and exit as expected Iain Sandoe
2023-01-07 17:34 ` Gaius Mulley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).