Last Comment Bug 488971 - 6 * |mailnews/base/test/TestMsgStripRE.cpp(102) : warning C4309: 'initializing' : truncation of constant value|
: 6 * |mailnews/base/test/TestMsgStripRE.cpp(102) : warning C4309: 'initializin...
Status: VERIFIED FIXED
:
Product: MailNews Core
Classification: Components
Component: Localization (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Thunderbird 11.0
Assigned To: :aceman
:
Mentors:
Depends on: 632429
Blocks: 319037
  Show dependency treegraph
 
Reported: 2009-04-18 04:05 PDT by Serge Gautherie (:sgautherie)
Modified: 2011-11-21 11:25 PST (History)
1 user (show)
standard8: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
add "unsigned" (1.32 KB, patch)
2011-11-06 10:16 PST, :aceman
standard8: review+
Details | Diff | Splinter Review

Description Serge Gautherie (:sgautherie) 2009-04-18 04:05:48 PDT
[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.
Comment 1 Dan Mosedale (:dmose) 2009-04-20 09:54:06 PDT
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?
Comment 2 Serge Gautherie (:sgautherie) 2009-04-20 19:45:15 PDT
(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
Comment 3 Serge Gautherie (:sgautherie) 2009-04-20 19:53:41 PDT
octal: 0303, 0206, 0303, 0230, 0303, 0205
deci.:  195,  134,  195,  152,  195,  133

Ah, actually, all need 'unsigned'!
Comment 4 Dan Mosedale (:dmose) 2009-04-22 09:12:13 PDT
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!
Comment 5 :aceman 2011-11-06 10:16:09 PST
Created attachment 572310 [details] [diff] [review]
add "unsigned"

Added unsigned type according to the discussion. Can't say if the test works this way.
Comment 6 Ludovic Hirlimann [:Usul] 2011-11-07 00:57:50 PST
Comment on attachment 572310 [details] [diff] [review]
add "unsigned"

Dmose isn't active in mailnews anymore swithcing the review to Mark.
Comment 7 Serge Gautherie (:sgautherie) 2011-11-07 19:18:57 PST
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).
Comment 8 Mark Banner (:standard8) 2011-11-10 03:05:07 PST
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.
Comment 9 Mark Banner (:standard8) 2011-11-16 02:46:24 PST
Checked in: http://hg.mozilla.org/comm-central/rev/415929bb2436

Note You need to log in before you can comment on or make changes to this bug.