All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gresolv: add missing include to fix clang-16 build
@ 2022-09-22 15:45 Ben Kohler
  2022-09-26  6:21 ` Daniel Wagner
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Kohler @ 2022-09-22 15:45 UTC (permalink / raw)
  To: connman

Current compilers gcc-12 and clang-15 warn about an implicit function
declaration in gresolv.c, and this turns into a fatal error in clang-16
and eventually in future gcc.
---
 gweb/gresolv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 954e7cfe..7c58e055 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -36,6 +36,7 @@
 #include <arpa/inet.h>
 #include <arpa/nameser.h>
 #include <net/if.h>
+#include <cdefs.h>
 
 #include "gresolv.h"
 
-- 
2.37.3


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

* Re: [PATCH] gresolv: add missing include to fix clang-16 build
  2022-09-22 15:45 [PATCH] gresolv: add missing include to fix clang-16 build Ben Kohler
@ 2022-09-26  6:21 ` Daniel Wagner
  2022-09-27 13:49   ` Kohler, Benjamin
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Wagner @ 2022-09-26  6:21 UTC (permalink / raw)
  To: Ben Kohler; +Cc: connman

On Thu, Sep 22, 2022 at 10:45:17AM -0500, Ben Kohler wrote:
> Current compilers gcc-12 and clang-15 warn about an implicit function
> declaration in gresolv.c, and this turns into a fatal error in clang-16
> and eventually in future gcc.
> ---
>  gweb/gresolv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/gweb/gresolv.c b/gweb/gresolv.c
> index 954e7cfe..7c58e055 100644
> --- a/gweb/gresolv.c
> +++ b/gweb/gresolv.c
> @@ -36,6 +36,7 @@
>  #include <arpa/inet.h>
>  #include <arpa/nameser.h>
>  #include <net/if.h>
> +#include <cdefs.h>

I use a gcc-12 compiler locally and don't get any warning. I suppose you are
passing additional build flags.

Anyway, this gives me:

gweb/gresolv.c:39:10: fatal error: cdefs.h: No such file or directory
   39 | #include <cdefs.h>
      |          ^~~~~~~~~

Is this supposed to be

#include <sys/cdefs.h> ?

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

* Re: [PATCH] gresolv: add missing include to fix clang-16 build
  2022-09-26  6:21 ` Daniel Wagner
@ 2022-09-27 13:49   ` Kohler, Benjamin
  2022-09-27 16:53     ` Daniel Wagner
  0 siblings, 1 reply; 4+ messages in thread
From: Kohler, Benjamin @ 2022-09-27 13:49 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: connman

Sorry, I had a working patch but then submitted a different one based on 
gcc's warning message recommendation.  This should work better:

---
  gweb/gresolv.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 954e7cfe..7c58e055 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -36,6 +36,7 @@
  #include <arpa/inet.h>
  #include <arpa/nameser.h>
  #include <net/if.h>
+#include <ctype.h>
  
  #include "gresolv.h"
  
-- 2.37.3

On 9/26/2022 1:21 AM, Daniel Wagner wrote:
> On Thu, Sep 22, 2022 at 10:45:17AM -0500, Ben Kohler wrote:
>> Current compilers gcc-12 and clang-15 warn about an implicit function
>> declaration in gresolv.c, and this turns into a fatal error in clang-16
>> and eventually in future gcc.
>> ---
>>   gweb/gresolv.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/gweb/gresolv.c b/gweb/gresolv.c
>> index 954e7cfe..7c58e055 100644
>> --- a/gweb/gresolv.c
>> +++ b/gweb/gresolv.c
>> @@ -36,6 +36,7 @@
>>   #include <arpa/inet.h>
>>   #include <arpa/nameser.h>
>>   #include <net/if.h>
>> +#include <cdefs.h>
> I use a gcc-12 compiler locally and don't get any warning. I suppose you are
> passing additional build flags.
>
> Anyway, this gives me:
>
> gweb/gresolv.c:39:10: fatal error: cdefs.h: No such file or directory
>     39 | #include <cdefs.h>
>        |          ^~~~~~~~~
>
> Is this supposed to be
>
> #include <sys/cdefs.h> ?
>

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

* Re: [PATCH] gresolv: add missing include to fix clang-16 build
  2022-09-27 13:49   ` Kohler, Benjamin
@ 2022-09-27 16:53     ` Daniel Wagner
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2022-09-27 16:53 UTC (permalink / raw)
  To: Kohler, Benjamin; +Cc: connman

On Tue, Sep 27, 2022 at 08:49:25AM -0500, Kohler, Benjamin wrote:
> Sorry, I had a working patch but then submitted a different one based on
> gcc's warning message recommendation.  This should work better:

Thanks! Patch applied!

Daniel

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

end of thread, other threads:[~2022-09-27 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 15:45 [PATCH] gresolv: add missing include to fix clang-16 build Ben Kohler
2022-09-26  6:21 ` Daniel Wagner
2022-09-27 13:49   ` Kohler, Benjamin
2022-09-27 16:53     ` Daniel Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.