* [DT-UTILS PATCH 1/2] common: Rename strlcpy to DT_strlcpy
@ 2017-06-23 10:18 Marcin Niestroj
2017-06-23 10:18 ` [DT-UTILS PATCH 2/2] common: Include sys/types.h header Marcin Niestroj
2017-06-27 6:32 ` [DT-UTILS PATCH 1/2] common: Rename strlcpy to DT_strlcpy Sascha Hauer
0 siblings, 2 replies; 3+ messages in thread
From: Marcin Niestroj @ 2017-06-23 10:18 UTC (permalink / raw)
To: barebox; +Cc: Marcin Niestroj
strlcpy function is defined in uClibc library, causing "static
declaration of ‘strlcpy’ follows non-static declaration" build
errors.
Rename internal strlcpy function to DT_strlcpy to avoid conflicts.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
---
src/dt/common.h | 4 ++--
src/libdt.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/dt/common.h b/src/dt/common.h
index f6bad44..992e28f 100644
--- a/src/dt/common.h
+++ b/src/dt/common.h
@@ -168,7 +168,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
#define basprintf(fmt, arg...) barebox_asprintf(fmt, ##arg)
/**
- * strlcpy - Copy a %NUL terminated string into a sized buffer
+ * DT_strlcpy - Copy a %NUL terminated string into a sized buffer
* @dest: Where to copy the string to
* @src: Where to copy the string from
* @size: size of destination buffer
@@ -178,7 +178,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
* of course, the buffer size is zero). It does not pad
* out the result like strncpy() does.
*/
-static inline size_t strlcpy(char *dest, const char *src, size_t size)
+static inline size_t DT_strlcpy(char *dest, const char *src, size_t size)
{
size_t ret = strlen(src);
diff --git a/src/libdt.c b/src/libdt.c
index 4db5160..3adeed2 100644
--- a/src/libdt.c
+++ b/src/libdt.c
@@ -1503,7 +1503,7 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
if (!compatible || strlen(compatible) > cplen)
return -ENODEV;
p = strchr(compatible, ',');
- strlcpy(modalias, p ? p + 1 : compatible, len);
+ DT_strlcpy(modalias, p ? p + 1 : compatible, len);
return 0;
}
--
2.13.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* [DT-UTILS PATCH 2/2] common: Include sys/types.h header
2017-06-23 10:18 [DT-UTILS PATCH 1/2] common: Rename strlcpy to DT_strlcpy Marcin Niestroj
@ 2017-06-23 10:18 ` Marcin Niestroj
2017-06-27 6:32 ` [DT-UTILS PATCH 1/2] common: Rename strlcpy to DT_strlcpy Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Marcin Niestroj @ 2017-06-23 10:18 UTC (permalink / raw)
To: barebox; +Cc: Marcin Niestroj
Build with musl library fails with following error:
In file included from src/crypto/sha1.c:21:0:
./src/digest.h:95:10: error: unknown type name ‘ulong’
ulong start, ulong size);
...
Fix that by including sys/types.h header in common.h, so ulong type
is defined with musl library.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
---
src/dt/common.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/dt/common.h b/src/dt/common.h
index 992e28f..1425c53 100644
--- a/src/dt/common.h
+++ b/src/dt/common.h
@@ -13,6 +13,7 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <mtd/mtd-abi.h>
--
2.13.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [DT-UTILS PATCH 1/2] common: Rename strlcpy to DT_strlcpy
2017-06-23 10:18 [DT-UTILS PATCH 1/2] common: Rename strlcpy to DT_strlcpy Marcin Niestroj
2017-06-23 10:18 ` [DT-UTILS PATCH 2/2] common: Include sys/types.h header Marcin Niestroj
@ 2017-06-27 6:32 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2017-06-27 6:32 UTC (permalink / raw)
To: Marcin Niestroj; +Cc: barebox
On Fri, Jun 23, 2017 at 12:18:47PM +0200, Marcin Niestroj wrote:
> strlcpy function is defined in uClibc library, causing "static
> declaration of ‘strlcpy’ follows non-static declaration" build
> errors.
>
> Rename internal strlcpy function to DT_strlcpy to avoid conflicts.
>
> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
> ---
Applied, thanks
Sascha
> src/dt/common.h | 4 ++--
> src/libdt.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/dt/common.h b/src/dt/common.h
> index f6bad44..992e28f 100644
> --- a/src/dt/common.h
> +++ b/src/dt/common.h
> @@ -168,7 +168,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
> #define basprintf(fmt, arg...) barebox_asprintf(fmt, ##arg)
>
> /**
> - * strlcpy - Copy a %NUL terminated string into a sized buffer
> + * DT_strlcpy - Copy a %NUL terminated string into a sized buffer
> * @dest: Where to copy the string to
> * @src: Where to copy the string from
> * @size: size of destination buffer
> @@ -178,7 +178,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
> * of course, the buffer size is zero). It does not pad
> * out the result like strncpy() does.
> */
> -static inline size_t strlcpy(char *dest, const char *src, size_t size)
> +static inline size_t DT_strlcpy(char *dest, const char *src, size_t size)
> {
> size_t ret = strlen(src);
>
> diff --git a/src/libdt.c b/src/libdt.c
> index 4db5160..3adeed2 100644
> --- a/src/libdt.c
> +++ b/src/libdt.c
> @@ -1503,7 +1503,7 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
> if (!compatible || strlen(compatible) > cplen)
> return -ENODEV;
> p = strchr(compatible, ',');
> - strlcpy(modalias, p ? p + 1 : compatible, len);
> + DT_strlcpy(modalias, p ? p + 1 : compatible, len);
> return 0;
> }
>
> --
> 2.13.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-27 6:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23 10:18 [DT-UTILS PATCH 1/2] common: Rename strlcpy to DT_strlcpy Marcin Niestroj
2017-06-23 10:18 ` [DT-UTILS PATCH 2/2] common: Include sys/types.h header Marcin Niestroj
2017-06-27 6:32 ` [DT-UTILS PATCH 1/2] common: Rename strlcpy to DT_strlcpy Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox