Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Turn on -Werror=writable-strings #4826

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

montegoulding
Copy link
Member

No description provided.

@peter-b
Copy link
Contributor

peter-b commented Oct 31, 2016

@montegoulding I'm not sure this is a good idea. Several places in this patch are exposing places where APIs should take const char* argument rather than char * arguments, and I feel like adding casts to remove const is really just papering over the cracks rather than actually fixing the problem that the compiler is complaining about.

I personally would be much happier with doing a minor refactor in each of these places to remove the writable-pointer-to-immutable-string entirely, and only then adding -Werror=writable-strings. I'm not totally sure what the best option is here, though... maybe what's needed is a second opinion.

/cc @livecodefraser

@montegoulding
Copy link
Member Author

@peter-b fair enough... There's probably a mix of things that should be refactored here and things that are OK being cast. replaceString can probably just be changed to const char * params as it is only called in one place. Some things it isn't worthwhile to refactor like the AddError in video grabber. Some things I'm not really sure about like initing DBString with an empty string....

@peter-b peter-b modified the milestones: 9.0.0-dp-3, 9.0.0-dp-4 Nov 21, 2016
@livecodepanos livecodepanos modified the milestones: 9.0.0-dp-5, 9.0.0-dp-4 Dec 20, 2016
@peter-b peter-b modified the milestones: 9.0.0-dp-5, 9.0.0-dp-6 Feb 24, 2017
@livecodeali livecodeali modified the milestones: 9.0.0-dp-6, 9.0.0-dp-7 Mar 1, 2017
@livecodepanos livecodepanos removed this from the 9.0.0-dp-7 milestone Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants