all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23758: 25.1.50; Bogus warning from -Wwrite-strings
@ 2016-06-12 19:56 Ken Brown
  2016-06-12 20:01 ` Noam Postavsky
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Brown @ 2016-06-12 19:56 UTC (permalink / raw)
  To: 23758

I'm getting an "assignment discards ‘const’ qualifier from pointer
target type" warning in the Cygwin-w32 build because of the following
code in w32fns.c:

char *type_CtrlAlt = NULL;
[...]
type_CtrlAlt = "bB";

This warning goes away if I remove -Wwrite-strings from the enabled 
compiler warnings.  Is this a compiler bug, or is there really something 
wrong with the code above that should warrant a warning?


In GNU Emacs 25.1.50.11 (x86_64-unknown-cygwin)
  of 2016-06-12 built on moufang
Repository revision: eacdc9eb6c89346fb72535632a1c65f6483b639f
Windowing system distributor 'Microsoft Corp.', version 10.0.10586

Configured using:
  'configure 'CFLAGS=-g3 -O0' --with-w32'






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

* bug#23758: 25.1.50; Bogus warning from -Wwrite-strings
  2016-06-12 19:56 bug#23758: 25.1.50; Bogus warning from -Wwrite-strings Ken Brown
@ 2016-06-12 20:01 ` Noam Postavsky
  2016-06-12 21:45   ` Ken Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Noam Postavsky @ 2016-06-12 20:01 UTC (permalink / raw)
  To: Ken Brown; +Cc: 23758

On Sun, Jun 12, 2016 at 3:56 PM, Ken Brown <kbrown@cornell.edu> wrote:
> I'm getting an "assignment discards ‘const’ qualifier from pointer
> target type" warning in the Cygwin-w32 build because of the following
> code in w32fns.c:
>
> char *type_CtrlAlt = NULL;
> [...]
> type_CtrlAlt = "bB";
>
> This warning goes away if I remove -Wwrite-strings from the enabled compiler
> warnings.  Is this a compiler bug, or is there really something wrong with
> the code above that should warrant a warning?

I think the warning is correct, and the code shoud use const char *type_CtrlAlt





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

* bug#23758: 25.1.50; Bogus warning from -Wwrite-strings
  2016-06-12 20:01 ` Noam Postavsky
@ 2016-06-12 21:45   ` Ken Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Ken Brown @ 2016-06-12 21:45 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 23758-done

On 6/12/2016 4:01 PM, Noam Postavsky wrote:
> On Sun, Jun 12, 2016 at 3:56 PM, Ken Brown <kbrown@cornell.edu> wrote:
>> I'm getting an "assignment discards ‘const’ qualifier from pointer
>> target type" warning in the Cygwin-w32 build because of the following
>> code in w32fns.c:
>>
>> char *type_CtrlAlt = NULL;
>> [...]
>> type_CtrlAlt = "bB";
>>
>> This warning goes away if I remove -Wwrite-strings from the enabled compiler
>> warnings.  Is this a compiler bug, or is there really something wrong with
>> the code above that should warrant a warning?
>
> I think the warning is correct, and the code shoud use const char *type_CtrlAlt

Thank you.  I was confused by the wording of the warning, but now I 
understand the issue.

Closing.

Ken






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

end of thread, other threads:[~2016-06-12 21:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-12 19:56 bug#23758: 25.1.50; Bogus warning from -Wwrite-strings Ken Brown
2016-06-12 20:01 ` Noam Postavsky
2016-06-12 21:45   ` Ken Brown

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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.