Re: [Linuxptp-devel] [PATCH 1/2] include string.h for strncpy()
On Fri, Oct 20, 2023 at 01:24:51PM -0700, Khem Raj wrote: > Newer compilers complain about missing signatures for stncpy as said in > subject. Well, the why not state which compiler was used, and also share the warning output? Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Re: [Linuxptp-devel] [PATCH 1/2] include string.h for strncpy()
On Fri, 20 Oct, 2023 12:47:39 -0700 Richard Cochran wrote: > On Thu, Oct 19, 2023 at 03:50:20PM +0100, Luca Fancellu wrote: >> From: Khem Raj >> >> Signed-off-by: Khem Raj >> --- >> interface.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/interface.c b/interface.c >> index 29229ad6f53d..9a83c36933e7 100644 >> --- a/interface.c >> +++ b/interface.c >> @@ -5,6 +5,7 @@ >> * @note SPDX-License-Identifier: GPL-2.0+ >> */ >> #include >> +#include >> #include "interface.h" > > What problem does this fix? Isn't this resolving the issue that string.h is the c library standard include for strncpy? In section 7.26.2.5 of the C standard draft N3047, it is shown the you must include string.h as the proper header including the declaration for strncpy. With some toolchains, not explicitly including the header may work, but it's not a guarantee by the standard from my understanding. * https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3047.pdf * https://godbolt.org/z/7YG7KGab8 -- Thanks, Rahul Rameshbabu ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Re: [Linuxptp-devel] [PATCH 1/2] include string.h for strncpy()
On Thu, Oct 19, 2023 at 03:50:20PM +0100, Luca Fancellu wrote: > From: Khem Raj > > Signed-off-by: Khem Raj > --- > interface.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/interface.c b/interface.c > index 29229ad6f53d..9a83c36933e7 100644 > --- a/interface.c > +++ b/interface.c > @@ -5,6 +5,7 @@ > * @note SPDX-License-Identifier: GPL-2.0+ > */ > #include > +#include > #include "interface.h" What problem does this fix? Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
[Linuxptp-devel] [PATCH 1/2] include string.h for strncpy()
From: Khem Raj Signed-off-by: Khem Raj --- interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/interface.c b/interface.c index 29229ad6f53d..9a83c36933e7 100644 --- a/interface.c +++ b/interface.c @@ -5,6 +5,7 @@ * @note SPDX-License-Identifier: GPL-2.0+ */ #include +#include #include "interface.h" struct interface { -- 2.34.1 ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel