In <TestEncoding.cpp>, multiple "warning C4309: 'initializing' : truncation of constant value"

RESOLVED FIXED in mozilla1.9.1a2

Status

()

Core
XPCOM
--
minor
RESOLVED FIXED
10 years ago
5 years ago

People

(Reporter: sgautherie, Assigned: sgautherie)

Tracking

(Blocks: 1 bug)

Trunk
mozilla1.9.1a2
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

10 years ago
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1a2pre) Gecko/2008080519 SeaMonkey/2.0a1pre] (home, optim default) (W2Ksp4)

{{
.../xpcom/tests/TestEncoding.cpp(61) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(61) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(61) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(61) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(105) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(105) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(105) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(105) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(105) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(105) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(148) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(148) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(148) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(191) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(191) : warning C4309: 'initializing' : truncation of constant value
.../xpcom/tests/TestEncoding.cpp(191) : warning C4309: 'initializing' : truncation of constant value
}}

Clean up the output.
(Assignee)

Comment 1

10 years ago
Created attachment 332432 [details] [diff] [review]
(Av1) <TestEncoding.cpp>

[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1a2pre) Gecko/2008080519 SeaMonkey/2.0a1pre] (home, optim default) (W2Ksp4)

*Remove an extra space.
*s/0x0/0x00/g
*Add casts.
Assignee: nobody → sgautherie.bz
Status: NEW → ASSIGNED
Attachment #332432 - Flags: review?(bsmedberg)
(Assignee)

Comment 2

10 years ago
Created attachment 333054 [details] [diff] [review]
(Av2) <TestEncoding.cpp>

Av1, with bug 410708 comment 4 suggestion(s) ;-)
Attachment #332432 - Attachment is obsolete: true
Attachment #333054 - Flags: review?(bsmedberg)
Attachment #332432 - Flags: review?(bsmedberg)
(Assignee)

Updated

10 years ago
Attachment #333054 - Flags: review?(bsmedberg) → review?(benjamin)
(Assignee)

Updated

10 years ago
Attachment #333054 - Flags: superreview?(benjamin)

Comment 3

10 years ago
Comment on attachment 333054 [details] [diff] [review]
(Av2) <TestEncoding.cpp>

I'm not sure I understand which changes are fixing what.

I understand why you might need '\xEF' instead of 0xEF in a char initializer, because char may be an unsigned type.

Is PRUnichar a signed type on windows (it's a typedef of wchar_t)?

I'm pretty sure (I hope!) that the change to 0x00 is not required, and I think it makes the code less readable... please prove me right.
Attachment #333054 - Flags: superreview?(benjamin)
Attachment #333054 - Flags: review?(benjamin)
Attachment #333054 - Flags: review-
(Assignee)

Comment 4

10 years ago
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b1pre) Gecko/20080927200111 Minefield/3.1b1pre] (home, debug default) (W2Ksp4)

Not sure if the two issues are related,
but, as this is the same test, reporting it here for now:
{
Running TestEncoding
WARNING: got a low Surrogate but no high surrogate: ...\include\string\nsUTF8Utils.h, line 718
WARNING: got a high Surrogate but no low surrogate: ...\include\string\nsUTF8Utils.h, line 709
WARNING: got a low Surrogate but no high surrogate: ...\include\string\nsUTF8Utils.h, line 631
WARNING: got a High Surrogate but no low surrogate: ...\include\string\nsUTF8Utils.h, line 619
WARNING: got a low Surrogate but no high surrogate: ...\include\string\nsUTF8Utils.h, line 361
WARNING: got a High Surrogate but no low surrogate: ...\include\string\nsUTF8Utils.h, line 345
WARNING: got a high Surrogate but no low surrogate: ...\include\string\nsUTF8Utils.h, line 709
WARNING: got a High Surrogate but no low surrogate: ...\include\string\nsUTF8Utils.h, line 619
WARNING: got a High Surrogate but no low surrogate: ...\include\string\nsUTF8Utils.h, line 345
WARNING: got a low Surrogate but no high surrogate: ...\include\string\nsUTF8Utils.h, line 718
WARNING: got a low Surrogate but no high surrogate: ...\include\string\nsUTF8Utils.h, line 631
WARNING: got a low Surrogate but no high surrogate: ...\include\string\nsUTF8Utils.h, line 361
Running TestEncoding tests...
}

Updated

7 years ago
Whiteboard: [build_warning]

Updated

7 years ago
Blocks: 187528

Comment 5

5 years ago
Can this be resolved?

The TestEncoding.cpp warnings were fixed in Bug 552805.

The NS_WARNINGS in nsUTF8Utils.h still seem to be there however...
Flags: needinfo?(sgautherie.bz)

Comment 6

5 years ago
sgautherie, ping...

Comment 7

5 years ago
Since the primary issue this bug was reported against was fixed (see Comment 5), and it has been a month without any reply, I am resolving this bug for now...
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: needinfo?(sgautherie.bz)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.