Closed Bug 797229 Opened 7 years ago Closed 7 years ago

Fix two warnings in updater.cpp

Categories

(Toolkit :: Application Update, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: ehsan, Assigned: ehsan)

Details

Attachments

(1 file)

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*.
Attached patch Patch (v1)Splinter Review
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+
(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*.
https://hg.mozilla.org/integration/mozilla-inbound/rev/79ee01ec38b7
Target Milestone: --- → mozilla18
https://hg.mozilla.org/mozilla-central/rev/79ee01ec38b7
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.