mailing list of musl libc
 help / color / mirror / Atom feed
* [musl] [PATCH] remove return with expression in void function
@ 2021-04-27 22:59 Michael Forney
  2021-04-28  1:57 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Forney @ 2021-04-27 22:59 UTC (permalink / raw)
  To: musl

ISO C says

> A return statement with an expression shall not appear in a
> function whose return type is void
---
 src/malloc/free.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/malloc/free.c b/src/malloc/free.c
index f17a952c..3944f7b2 100644
--- a/src/malloc/free.c
+++ b/src/malloc/free.c
@@ -2,5 +2,5 @@
 
 void free(void *p)
 {
-	return __libc_free(p);
+	__libc_free(p);
 }
-- 
2.31.1


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

* Re: [musl] [PATCH] remove return with expression in void function
  2021-04-27 22:59 [musl] [PATCH] remove return with expression in void function Michael Forney
@ 2021-04-28  1:57 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2021-04-28  1:57 UTC (permalink / raw)
  To: musl

On Tue, Apr 27, 2021 at 03:59:55PM -0700, Michael Forney wrote:
> ISO C says
> 
> > A return statement with an expression shall not appear in a
> > function whose return type is void
> ---
>  src/malloc/free.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/malloc/free.c b/src/malloc/free.c
> index f17a952c..3944f7b2 100644
> --- a/src/malloc/free.c
> +++ b/src/malloc/free.c
> @@ -2,5 +2,5 @@
>  
>  void free(void *p)
>  {
> -	return __libc_free(p);
> +	__libc_free(p);
>  }
> -- 
> 2.31.1

Thanks, applying!

Rich

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

end of thread, other threads:[~2021-04-28  1:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 22:59 [musl] [PATCH] remove return with expression in void function Michael Forney
2021-04-28  1:57 ` Rich Felker

mailing list of musl libc

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/musl

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 musl musl/ http://inbox.vuxu.org/musl \
		musl@inbox.vuxu.org
	public-inbox-index musl

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/musl/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git