Fix two warnings in updater.cpp

RESOLVED FIXED in mozilla18

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

unspecified
mozilla18
x86
macOS
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
toolkit/mozapps/update/updater/updater.cpp:2035:1 [-Wunused-function] unused function 'ReadMARChannelIDs'
toolkit/mozapps/update/updater/updater.cpp:2132:14 [-Wdeprecated-writable-strings] conversion from string literal to 'char *' is deprecated

The first one is easy.  The second one is technically a bug, since putenv() accepts a char*, not a const char*.
(Assignee)

Comment 1

6 years ago
Created attachment 667272 [details] [diff] [review]
Patch (v1)
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #667272 - Flags: review?(netzen)
Comment on attachment 667272 [details] [diff] [review]
Patch (v1)

Review of attachment 667272 [details] [diff] [review]:
-----------------------------------------------------------------

(In reply to Ehsan Akhgari [:ehsan] from comment #0)
> The first one is easy.  The second one is technically a bug, since putenv()
> accepts a char*, not a const char*.

Hrm, is it implementation specific or is one of these 2 documentation pages wrong?
http://www.bigbiz.com/cgi-bin/manpage?3+putenv
http://linux.die.net/man/3/putenv
MSDN also lists it as a const char* btw.
Attachment #667272 - Flags: review?(netzen) → review+
(Assignee)

Comment 3

6 years ago
(In reply to comment #2)
> Comment on attachment 667272 [details] [diff] [review]
>   --> https://bugzilla.mozilla.org/attachment.cgi?id=667272
> Patch (v1)
> 
> Review of attachment 667272 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> (In reply to Ehsan Akhgari [:ehsan] from comment #0)
> > The first one is easy.  The second one is technically a bug, since putenv()
> > accepts a char*, not a const char*.
> 
> Hrm, is it implementation specific or is one of these 2 documentation pages
> wrong?
> http://www.bigbiz.com/cgi-bin/manpage?3+putenv
> http://linux.die.net/man/3/putenv
> MSDN also lists it as a const char* btw.

Unix defines it as char* <http://pubs.opengroup.org/onlinepubs/009604599/functions/putenv.html>, and both on my Mac and Ubuntu box, it's char*.
(Assignee)

Comment 4

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/79ee01ec38b7
Target Milestone: --- → mozilla18
https://hg.mozilla.org/mozilla-central/rev/79ee01ec38b7
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.