Closed Bug 488971 Opened 15 years ago Closed 13 years ago

6 * |mailnews/base/test/TestMsgStripRE.cpp(102) : warning C4309: 'initializing' : truncation of constant value|

Categories

(MailNews Core :: Localization, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Thunderbird 11.0

People

(Reporter: sgautherie, Assigned: aceman)

References

Details

Attachments

(1 file)

[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090417 SeaMonkey/2.0b1pre] (experimental/_m-c_, home, optim default) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/9e06217fc471
 +http://hg.mozilla.org/comm-central/rev/...)

Code is
{
  static const char utf8Prefixes[] = 
    {'S', 'V', ',', 0303, 0206, 0303, 0230, 0303, 0205, '\0'}; 
}
in which (I think):
*|02xx| would need 'unsigned'.
*|0303| just can't fit anyway.
Constants that start with the number 0 are supposed to be interpreted by the compiler as octal, not decimal, so I would expect those all to fit.

Can you paste the complete warning message with context into the bug?

What version of what compiler is this?
(In reply to comment #1)
> Constants that start with the number 0 are supposed to be interpreted by the
> compiler as octal, not decimal, so I would expect those all to fit.

Oh, yet...
(octal: why not use hexa or decimal?)

> Can you paste the complete warning message with context into the bug?
> What version of what compiler is this?

Linux:
http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird/1240223862.1240227669.17537.gz&fulltext=1
MacOSX: (no warnings)
http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird/1240016749.1240023373.12834.gz&fulltext=1
Windows:
http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird/1239921058.1239928583.20321.gz&fulltext=1
octal: 0303, 0206, 0303, 0230, 0303, 0205
deci.:  195,  134,  195,  152,  195,  133

Ah, actually, all need 'unsigned'!
I think I used octal because I generated that string using some utility (od, maybe) that give it to me that way by default.  Good catch on the unsigned piece; whoops!
Whiteboard: [good first bug]
Attached patch add "unsigned"Splinter Review
Added unsigned type according to the discussion. Can't say if the test works this way.
Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #572310 - Flags: review?(dmose)
Comment on attachment 572310 [details] [diff] [review]
add "unsigned"

Dmose isn't active in mailnews anymore swithcing the review to Mark.
Attachment #572310 - Flags: review?(dmose) → review?(mbanner)
Comment on attachment 572310 [details] [diff] [review]
add "unsigned"

While there, why not switch from octal to (more common) hexa or decimal?


(In reply to :aceman from comment #5)
> Can't say if the test works this way.

Bug 659205 comment 12 removed this test (and 3 other ones) from build.
I'm not sure what the plan was/is w.r.t. these files (in the repository).
Attachment #572310 - Flags: feedback?(iann_bugzilla)
Depends on: 659205
Comment on attachment 572310 [details] [diff] [review]
add "unsigned"

Ok, via a bit of makefile hacking I was able to get it to at least try to compile even if it didn't link. That was enough to prove the warnings go away, and will improve this if we're able to get it going in future.

Re octal & others: octal is quite standard format and gets used frequently. I don't think we need to change it here.
Attachment #572310 - Flags: review?(mbanner)
Attachment #572310 - Flags: review+
Attachment #572310 - Flags: feedback?(iann_bugzilla)
Checked in: http://hg.mozilla.org/comm-central/rev/415929bb2436
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 11.0
Whiteboard: [good first bug]
Depends on: 702937
No longer depends on: 659205
Depends on: 632429
No longer depends on: 702937
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: