Repository navigation
Warnings during compile for v0.2.7 #87
Copy link
Copy link
Closed
Description
I was updating the conda-forge feedstock to 0.2.7 and noticed the following warnings in the builds for linux and os x. Full logs here:
https://circleci.com/gh/conda-forge/python-rapidjson-feedstock/tree/pull%2F6
https://travis-ci.org/conda-forge/python-rapidjson-feedstock/builds/314361977
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
./rapidjson.cpp:1145:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
};
^
./rapidjson.cpp:1145:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:1145:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:1145:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:1145:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:1145:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:1145:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:1145:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
};
^
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:2250:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./rapidjson.cpp:1136:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"datetime_mode",
^
./rapidjson.cpp:1137:63: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(DecoderObject, datetimeMode), READONLY, "datetime_mode"},
^
./rapidjson.cpp:1138:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"uuid_mode",
^
./rapidjson.cpp:1139:59: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(DecoderObject, uuidMode), READONLY, "uuid_mode"},
^
./rapidjson.cpp:1140:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"number_mode",
^
./rapidjson.cpp:1141:61: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(DecoderObject, numberMode), READONLY, "number_mode"},
^
./rapidjson.cpp:1142:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"parse_mode",
^
./rapidjson.cpp:1143:60: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(DecoderObject, parseMode), READONLY, "parse_mode"},
^
./rapidjson.cpp:2233:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"skip_invalid_keys",
^
./rapidjson.cpp:2234:66: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_BOOL, offsetof(EncoderObject, skipInvalidKeys), READONLY, "skip_invalid_keys"},
^
./rapidjson.cpp:2235:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"ensure_ascii",
^
./rapidjson.cpp:2236:62: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_BOOL, offsetof(EncoderObject, ensureAscii), READONLY, "ensure_ascii"},
^
./rapidjson.cpp:2237:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"indent",
^
./rapidjson.cpp:2238:57: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(EncoderObject, indent), READONLY, "indent"},
^
./rapidjson.cpp:2239:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"sort_keys",
^
./rapidjson.cpp:2240:62: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_BOOL, offsetof(EncoderObject, ensureAscii), READONLY, "sort_keys"},
^
./rapidjson.cpp:2241:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"max_recursion_depth",
^
./rapidjson.cpp:2242:68: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(EncoderObject, maxRecursionDepth), READONLY, "max_recursion_depth"},
^
./rapidjson.cpp:2243:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"datetime_mode",
^
./rapidjson.cpp:2244:63: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(EncoderObject, datetimeMode), READONLY, "datetime_mode"},
^
./rapidjson.cpp:2245:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"uuid_mode",
^
./rapidjson.cpp:2246:59: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(EncoderObject, uuidMode), READONLY, "uuid_mode"},
^
./rapidjson.cpp:2247:6: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
{"number_mode",
^
./rapidjson.cpp:2248:61: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
T_UINT, offsetof(EncoderObject, numberMode), READONLY, "number_mode"},
^
24 warnings generated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Warnings during compile in linux[/-][+]Warnings during compile for v0.2.7[/+]hajapy commentedon Dec 10, 2017
Oh also for windows:
https://ci.appveyor.com/project/conda-forge/python-rapidjson-feedstock/build/1.0.7/job/j9kbi9ys65v8dptc#L389
lelit commentedon Dec 10, 2017
AFAICT the warnings about the constant strings are not avoidable (but starting with 3.6 more and more of those structs are defined with
const char *).The others, related to implicit conversion from double to int may be mitigated with an explicit cast, but should be otherwise safe.
hajapy commentedon Dec 10, 2017
Could the string literals in the structs be cast as (char *)"string_literal"?
lelit commentedon Dec 14, 2017
I tried in the past, but coercing string literals to
char*caused a different kind of warning, at least on GNU C++: that's whysetup.pyadds a-Wno-write-stringsoption when it detects that compiler chain.I added some explicit casts in commit fb355a0, can you please try latest master and tell me if that helps wrt the second set of warnings.
lelit commentedon Dec 20, 2017
I just released v0.3 and I'd be curious to know whether the mentioned changes ameliorated the Windows build.
hajapy commentedon Dec 20, 2017
Ok, trying here: conda-forge/python-rapidjson-feedstock#7
For future reference, you can fork the feedstock and change the recipe to use a git sha instead of a package off pypi if you want to test things before tagging a release.
hajapy commentedon Dec 20, 2017
seeing this on the windows x64 builds
lelit commentedon Dec 20, 2017
Thank you, will take a look!
lelit commentedon Dec 20, 2017
@hajapy, I pushed a couple of commits in https://github.com/lelit/python-rapidjson/tree/issue87: it would be nice if you could give that a try...
I'm sorry, but I do not have any WinXX machine around me (yeah, I'm a lucky boy ;-) so I'd really appreciate some help on that.
hajapy commentedon Dec 20, 2017
I'm trying here:
conda-forge/python-rapidjson-feedstock@master...hajapy:lelit2
https://ci.appveyor.com/project/hajapy/python-rapidjson-feedstock
I also do not have a local windows machine for testing. I am my fork of the conda-forge feedstock and enabled that as a build project on appveyor, so I can get it to test the recipe for me. I can help guide you to setting this up for yourself if you want to be able to do the same in the future.
lelit commentedon Dec 20, 2017
Oh, I completely misunderstood your hint then :)
Thank you, I will try that myself, but I'm afraid after xmas...
hajapy commentedon Dec 20, 2017
only warnings remaining in the x64 builds (note: I did not do mac/linux builds)
lelit commentedon Dec 21, 2017
Good, thanks!
I don't know how to deal with that warning, maybe its something done internally by the build (distutils?) process, as I do not explicitly create that
.expfile.lelit commentedon Dec 21, 2017
I released v0.3.2 with the mentioned fixes. Thank you again!