classification
Title: PyMethodDef ml_name is char* instead of const char*
Type: Stage: resolved
Components: Extension Modules Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, h.venev, loewis, methane, tshepang
Priority: normal Keywords:

Created on 2014-03-22 10:14 by h.venev, last changed 2019-03-28 13:20 by methane. This issue is now closed.

Messages (6)
msg214451 - (view) Author: Hristo Venev (h.venev) * Date: 2014-03-22 10:14
It would be better if string literals could be used there.
msg214463 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2014-03-22 11:45
Why are you suggesting that string literals cannot be used? Works fine for me.
msg214474 - (view) Author: Hristo Venev (h.venev) * Date: 2014-03-22 14:07
error: deprecated conversion from string constant to ‘char*’

I like -Werror.
msg214503 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2014-03-22 18:27
I still can't reproduce the problem, not even with -Werror:

loewis@dinsdale:~$ cat a.c
struct Foo{
  char *text;
};

struct Foo f = {
  "data"
};

int main()
{
  return 0;
}

loewis@dinsdale:~$ gcc -Wall -Werror -o a a.c
loewis@dinsdale:~$ gcc --version
gcc (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

loewis@dinsdale:~$
msg214506 - (view) Author: Hristo Venev (h.venev) * Date: 2014-03-22 18:59
g++
msg339033 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2019-03-28 13:20
It is const char* now.
History
Date User Action Args
2019-03-28 13:20:01methanesetstatus: open -> closed

nosy: + methane
messages: + msg339033

resolution: fixed
stage: resolved
2014-04-02 17:43:48tshepangsetnosy: + tshepang
2014-03-24 01:04:24Arfreversetnosy: + Arfrever
2014-03-22 18:59:44h.venevsetmessages: + msg214506
2014-03-22 18:27:02loewissetmessages: + msg214503
2014-03-22 14:07:09h.venevsetmessages: + msg214474
2014-03-22 11:45:45loewissetnosy: + loewis
messages: + msg214463
2014-03-22 10:19:32h.venevsetcomponents: + Extension Modules
versions: + Python 3.4
2014-03-22 10:14:14h.venevcreate