All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/kconfig: fix compiler warnings by increasing buffer sizes
@ 2019-08-01 15:20 Mark Corbin
  2019-08-01 16:09 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Corbin @ 2019-08-01 15:20 UTC (permalink / raw)
  To: buildroot

When compiling kconfig with host gcc 8.3.0 several compiler
'-Wformat-overflow=' warnings are generated. This is due to a
number of temporary buffers used by sprintf being too small.
The sizes of these buffers have been increased to remove the
warnings.

Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
---
 support/kconfig/confdata.c | 4 ++--
 support/kconfig/util.c     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/support/kconfig/confdata.c b/support/kconfig/confdata.c
index 892da74fdc..6f40588a89 100644
--- a/support/kconfig/confdata.c
+++ b/support/kconfig/confdata.c
@@ -744,7 +744,7 @@ int conf_write(const char *name)
 	struct menu *menu;
 	const char *basename;
 	const char *str;
-	char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
+	char dirname[PATH_MAX+1], tmpname[PATH_MAX+23], newname[PATH_MAX+1];
 	char *env;
 
 	if (!name)
@@ -974,7 +974,7 @@ int conf_write_autoconf(void)
 	const char *name;
 	FILE *out, *tristate, *out_h;
 	int i;
-	char dir[PATH_MAX+1], buf[PATH_MAX+1];
+	char dir[PATH_MAX+1], buf[PATH_MAX+20];
 	char *s;
 
 	strcpy(dir, conf_get_configname());
diff --git a/support/kconfig/util.c b/support/kconfig/util.c
index 18a8e52391..d051fbea13 100644
--- a/support/kconfig/util.c
+++ b/support/kconfig/util.c
@@ -35,7 +35,7 @@ struct file *file_lookup(const char *name)
 int file_write_dep(const char *name)
 {
 	char *str;
-	char buf[PATH_MAX+1], buf2[PATH_MAX+1], dir[PATH_MAX+1];
+	char buf[PATH_MAX+13], buf2[PATH_MAX+1], dir[PATH_MAX+1];
 	struct symbol *sym, *env_sym;
 	struct expr *e;
 	struct file *file;
-- 
2.19.1

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

* [Buildroot] [PATCH 1/1] support/kconfig: fix compiler warnings by increasing buffer sizes
  2019-08-01 15:20 [Buildroot] [PATCH 1/1] support/kconfig: fix compiler warnings by increasing buffer sizes Mark Corbin
@ 2019-08-01 16:09 ` Thomas Petazzoni
  2019-08-02 11:25   ` Mark Corbin
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2019-08-01 16:09 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu,  1 Aug 2019 16:20:05 +0100
Mark Corbin <mark.corbin@embecosm.com> wrote:

> When compiling kconfig with host gcc 8.3.0 several compiler
> '-Wformat-overflow=' warnings are generated. This is due to a
> number of temporary buffers used by sprintf being too small.
> The sizes of these buffers have been increased to remove the
> warnings.
> 
> Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
> ---
>  support/kconfig/confdata.c | 4 ++--
>  support/kconfig/util.c     | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

This was fixed in upstream Linux by commit
2ae89c7a82ea9d81a19b4fc2df23bef4b112f24e, which is part of Linux since
4.18. Our kconfig code base is based on 4.17-rc2, so the best thing is
to update our kconfig code base, to re-use the fixes from the kernel.

Could you do this ? Be careful that patches in support/kconfig/patches/
need to be refreshed and re-applied on top of the kernel kconfig code
base.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/1] support/kconfig: fix compiler warnings by increasing buffer sizes
  2019-08-01 16:09 ` Thomas Petazzoni
@ 2019-08-02 11:25   ` Mark Corbin
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Corbin @ 2019-08-02 11:25 UTC (permalink / raw)
  To: buildroot

Hello Thomas

On 01/08/2019 17:09, Thomas Petazzoni wrote:
> Hello,
>
> On Thu,  1 Aug 2019 16:20:05 +0100
> Mark Corbin <mark.corbin@embecosm.com> wrote:
>
>> When compiling kconfig with host gcc 8.3.0 several compiler
>> '-Wformat-overflow=' warnings are generated. This is due to a
>> number of temporary buffers used by sprintf being too small.
>> The sizes of these buffers have been increased to remove the
>> warnings.
>>
>> Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
>> ---
>>  support/kconfig/confdata.c | 4 ++--
>>  support/kconfig/util.c     | 2 +-
>>  2 files changed, 3 insertions(+), 3 deletions(-)
> This was fixed in upstream Linux by commit
> 2ae89c7a82ea9d81a19b4fc2df23bef4b112f24e, which is part of Linux since
> 4.18. Our kconfig code base is based on 4.17-rc2, so the best thing is
> to update our kconfig code base, to re-use the fixes from the kernel.
>
> Could you do this ? Be careful that patches in support/kconfig/patches/
> need to be refreshed and re-applied on top of the kernel kconfig code
> base.

I can take a look at this if I get some time.

Regards

Mark

-- 
Mark Corbin
Embecosm Ltd.
https://www.embecosm.com

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

end of thread, other threads:[~2019-08-02 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01 15:20 [Buildroot] [PATCH 1/1] support/kconfig: fix compiler warnings by increasing buffer sizes Mark Corbin
2019-08-01 16:09 ` Thomas Petazzoni
2019-08-02 11:25   ` Mark Corbin

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.