Closed
Bug 202716
Opened 22 years ago
Closed 22 years ago
Fix to provide a "Foolish consistency" in const attributes of parameters and thereby eliminate some compiler warnings
Categories
(Camino Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bfowler, Assigned: mikepinkerton)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
2.05 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4b) Gecko/20030418 Chimera/0.7+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4b) Gecko/20030418 Chimera/0.7+
gcc as called by Project Builder will warn if a programmer provides a
const char * where a char * is specified. These patches specifiy that
certain strings (which ought not to be modified) are marked as such
in the code.
Reproducible: Always
Steps to Reproduce:
1. Compile Camino with Project Builder
2.
3.
Actual Results:
Navigation.mm has two warnings
Expected Results:
A bit optimistic, but I would wish all code in Mozilla to compile with no
warnings (however much one turns up the 'pickiness' of the compiler) on all
widely used compilers.
Patch will follow submission
| Reporter | ||
Comment 1•22 years ago
|
||
| Reporter | ||
Comment 3•22 years ago
|
||
I think not. The files concerned contain Cocoa classes and belong
inside the PreferencesPane folder of the Camino port.
| Reporter | ||
Comment 4•22 years ago
|
||
It pains me to say that bug 173287 is a duplicate of this one and should be retired.
*** Bug 173287 has been marked as a duplicate of this bug. ***
Ben, if your patch is ready for review, be sure to set the appropriate flag on it.
| Reporter | ||
Comment 7•22 years ago
|
||
1. The flags popups are not visible in this browser. (Chimera 0.7+)/Jaguar 1.2.3
2. It is a three line patch and just needs looking at either by whoever is
in charge of the module, or whoever last modified the file. You know who
are! Just modify you sources and commit when convenient. There is no
intentional enhancement in functionality, or bug fix.
3. The need for setting a flag (whilst in the Bugzilla docs) is not described
in <URL: http://www.mozilla.org/hacking/life-cycle.html >, which whilst not
the only guide for helping with Mozilla, is one of the best written (of a very
fine bunch), and what I have been going by.
O.K. I. REQUEST A REVIEW FROM ANYONE HANDY.
Updated•22 years ago
|
Summary: Fix to provide a "Foolish consistency" in const attributes of parameters and thereby eliminate some compiler warnings → [has patch] Fix to provide a "Foolish consistency" in const attributes of parameters and thereby eliminate some compiler warnings
Updated•22 years ago
|
Blocks: buildwarning
| Assignee | ||
Updated•22 years ago
|
Attachment #121135 -
Flags: review?(pinkerton)
| Assignee | ||
Comment 8•22 years ago
|
||
mine.
Assignee: saari → pinkerton
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 9•22 years ago
|
||
I don't understand why a method would return a const NSString*. Maybe the
warnings should be fixed at the other end?
| Reporter | ||
Comment 10•22 years ago
|
||
I really hope that I am not going to make a fool of myself here, but returning
a 'const NSString *' to be means returning a pointer to an NSString that the
caller should not modify. If you like something that is read only.
If the caller attempts to modify it, then this can be detected at compile
time.
If this is on the wrong lines, then by all means fix the warning the opposite
way.
Comment 11•22 years ago
|
||
Perhaps pasting the warnings in here would help.
| Reporter | ||
Comment 12•22 years ago
|
||
These:
PreferencePanes/Navigation/Navigation.mm: In function
`-[OrgMozillaChimeraPreferenceNavigation getSystemHomePage]':
PreferencePanes/Navigation/Navigation.mm:289: warning: invalid conversion from
`const unsigned char*' to `unsigned char*'
PreferencePanes/Navigation/Navigation.mm: In function
`-[OrgMozillaChimeraPreferenceNavigation getSystemSearchPage]':
PreferencePanes/Navigation/Navigation.mm:304: warning: invalid conversion from
`const unsigned char*' to `unsigned char*'
| Assignee | ||
Comment 13•22 years ago
|
||
this patch is malformed. is it incomplete?
| Assignee | ||
Comment 14•22 years ago
|
||
Comment on attachment 121135 [details] [diff] [review]
Fix for compiler warnings
This doesn't fix the warnings which are totally unrelated to const char*'s.
Attachment #121135 -
Flags: review?(pinkerton) → review-
| Assignee | ||
Comment 15•22 years ago
|
||
fixed. (Str255 -> ConstStr255Param in param decl)
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Updated•22 years ago
|
Summary: [has patch] Fix to provide a "Foolish consistency" in const attributes of parameters and thereby eliminate some compiler warnings → Fix to provide a "Foolish consistency" in const attributes of parameters and thereby eliminate some compiler warnings
You need to log in
before you can comment on or make changes to this bug.
Description
•