linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Subject: [PATCH] Fix const definition without initialization
@ 2020-05-13  7:11 Hans Christian Lønstad
  2020-10-18 21:00 ` David Oberhollenzer
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Christian Lønstad @ 2020-05-13  7:11 UTC (permalink / raw)
  To: linux-mtd

From: Hans Christian Lonstad <hcl@datarespons.no>
Date: Tue, 12 May 2020 15:58:40 +0200
Subject: [PATCH] Fix const definition without initialization

Compile error using g++ 9.3. Remove const specifier given the structure is filled in run-time.
---
 include/libmtd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/libmtd.h b/include/libmtd.h
index cc24af8..dc339d1 100644
--- a/include/libmtd.h
+++ b/include/libmtd.h
@@ -77,8 +77,8 @@ struct mtd_dev_info
  int major;
  int minor;
  int type;
- const char type_str[MTD_TYPE_MAX + 1];
- const char name[MTD_NAME_MAX + 1];
+ char type_str[MTD_TYPE_MAX + 1];
+ char name[MTD_NAME_MAX + 1];
  long long size;
  int eb_cnt;
  int eb_size;
--
2.25.1

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: Subject: [PATCH] Fix const definition without initialization
  2020-05-13  7:11 Subject: [PATCH] Fix const definition without initialization Hans Christian Lønstad
@ 2020-10-18 21:00 ` David Oberhollenzer
  0 siblings, 0 replies; 2+ messages in thread
From: David Oberhollenzer @ 2020-10-18 21:00 UTC (permalink / raw)
  To: Hans Christian Lønstad, linux-mtd

Hi,

sorry for the delay. I must have missed this one on the ML but stumbled
over it today when going through the patchwork backlog.

Please use a prefix on the subject next time to highlight that this patch
is for mtd-utils.

Also, I had to fix some white space mangling to apply the patch on my end.

On 5/13/20 9:11 AM, Hans Christian Lønstad wrote:
> Compile error using g++ 9.3. Remove const specifier given the structure is filled in run-time.

Where do you get the compile error? Could you paste an error message?

I did a quick git-grep and it appears to me that the code that initializes
those fields explicitly casts the const away.

You wrote g++. Did you mean gcc or are you trying to force the C code through
a C++ compiler?

Thanks,

David

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2020-10-18 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13  7:11 Subject: [PATCH] Fix const definition without initialization Hans Christian Lønstad
2020-10-18 21:00 ` David Oberhollenzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).