diff mbox series

[2/7] dlmalloc: Fix a warning with clang-15

Message ID 20230227220839.2519733-2-trini@konsulko.com
State Accepted
Commit f88d48cc74f0e78b14fed812101d94de65e43802
Delegated to: Tom Rini
Headers show
Series [1/7] global: Disable deprecated-non-prototype warning with clang | expand

Commit Message

Tom Rini Feb. 27, 2023, 10:08 p.m. UTC
With clang-15 we now will get warnings such as:

warning: a function declaration without a prototype is deprecated in all
versions of C [-Wstrict-prototypes]

And it is easy enough to address this warning here, as we aren't
concerned with re-syncing with an upstream.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 common/dlmalloc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Simon Glass Feb. 28, 2023, 12:35 a.m. UTC | #1
Hi Tom,

On Mon, 27 Feb 2023 at 15:08, Tom Rini <trini@konsulko.com> wrote:
>
> With clang-15 we now will get warnings such as:
>
> warning: a function declaration without a prototype is deprecated in all
> versions of C [-Wstrict-prototypes]
>
> And it is easy enough to address this warning here, as we aren't
> concerned with re-syncing with an upstream.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  common/dlmalloc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

>
> diff --git a/common/dlmalloc.c b/common/dlmalloc.c
> index 41c7230424cc..0f9b7262d512 100644
> --- a/common/dlmalloc.c
> +++ b/common/dlmalloc.c
> @@ -80,7 +80,7 @@ GmListElement* makeGmListElement (void* bas)
>         return this;
>  }
>
> -void gcleanup ()
> +void gcleanup (void)

drop space before ( ?

>  {
>         BOOL rval;
>         assert ( (head == NULL) || (head->base == (void*)gAddressBase));
> @@ -2340,7 +2340,7 @@ size_t malloc_usable_size(mem) Void_t* mem;
>  /* Utility to update current_mallinfo for malloc_stats and mallinfo() */
>
>  #ifdef DEBUG
> -static void malloc_update_mallinfo()
> +static void malloc_update_mallinfo(void)
>  {
>    int i;
>    mbinptr b;
> @@ -2397,7 +2397,7 @@ static void malloc_update_mallinfo()
>  */
>
>  #ifdef DEBUG
> -void malloc_stats()
> +void malloc_stats(void)
>  {
>    malloc_update_mallinfo();
>    printf("max system bytes = %10u\n",
> @@ -2418,7 +2418,7 @@ void malloc_stats()
>  */
>
>  #ifdef DEBUG
> -struct mallinfo mALLINFo()
> +struct mallinfo mALLINFo(void)
>  {
>    malloc_update_mallinfo();
>    return current_mallinfo;
> --
> 2.34.1
>

Regards,
Simon
Tom Rini Feb. 28, 2023, 1:38 a.m. UTC | #2
On Mon, Feb 27, 2023 at 05:35:30PM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Mon, 27 Feb 2023 at 15:08, Tom Rini <trini@konsulko.com> wrote:
> >
> > With clang-15 we now will get warnings such as:
> >
> > warning: a function declaration without a prototype is deprecated in all
> > versions of C [-Wstrict-prototypes]
> >
> > And it is easy enough to address this warning here, as we aren't
> > concerned with re-syncing with an upstream.
> >
> > Signed-off-by: Tom Rini <trini@konsulko.com>
> > ---
> >  common/dlmalloc.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> >
> > diff --git a/common/dlmalloc.c b/common/dlmalloc.c
> > index 41c7230424cc..0f9b7262d512 100644
> > --- a/common/dlmalloc.c
> > +++ b/common/dlmalloc.c
> > @@ -80,7 +80,7 @@ GmListElement* makeGmListElement (void* bas)
> >         return this;
> >  }
> >
> > -void gcleanup ()
> > +void gcleanup (void)
> 
> drop space before ( ?

The file is so badly out of sync with our coding style I literally just
went and did %s/()$/(void)/ to move on to the next sets of problems. So
I'd rather not fix one more style issue here when I suspect there's a
barely exaggerated thousand more.
Tom Rini March 23, 2023, 1:17 a.m. UTC | #3
On Mon, Feb 27, 2023 at 05:08:34PM -0500, Tom Rini wrote:

> With clang-15 we now will get warnings such as:
> 
> warning: a function declaration without a prototype is deprecated in all
> versions of C [-Wstrict-prototypes]
> 
> And it is easy enough to address this warning here, as we aren't
> concerned with re-syncing with an upstream.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 41c7230424cc..0f9b7262d512 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -80,7 +80,7 @@  GmListElement* makeGmListElement (void* bas)
 	return this;
 }
 
-void gcleanup ()
+void gcleanup (void)
 {
 	BOOL rval;
 	assert ( (head == NULL) || (head->base == (void*)gAddressBase));
@@ -2340,7 +2340,7 @@  size_t malloc_usable_size(mem) Void_t* mem;
 /* Utility to update current_mallinfo for malloc_stats and mallinfo() */
 
 #ifdef DEBUG
-static void malloc_update_mallinfo()
+static void malloc_update_mallinfo(void)
 {
   int i;
   mbinptr b;
@@ -2397,7 +2397,7 @@  static void malloc_update_mallinfo()
 */
 
 #ifdef DEBUG
-void malloc_stats()
+void malloc_stats(void)
 {
   malloc_update_mallinfo();
   printf("max system bytes = %10u\n",
@@ -2418,7 +2418,7 @@  void malloc_stats()
 */
 
 #ifdef DEBUG
-struct mallinfo mALLINFo()
+struct mallinfo mALLINFo(void)
 {
   malloc_update_mallinfo();
   return current_mallinfo;