Fix warnings in content/base/src/Element.cpp

NEW
Unassigned

Status

()

Core
DOM
5 years ago
5 years ago

People

(Reporter: cojocaru.alex3010, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
49:29.38 /home/student/mozilla-central/content/base/src/Element.cpp: In member function ‘void mozilla::dom::Element::List(FILE*, int32_t, const nsCString&) const’:
49:29.39 Warning: -Wformat in /home/student/mozilla-central/content/base/src/Element.cpp: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘nsEventStates::InternalType {aka long unsigned int}’
49:29.39 /home/student/mozilla-central/content/base/src/Element.cpp:2117:59: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘nsEventStates::InternalType {aka long unsigned int}’ [-Wformat]
(Reporter)

Comment 1

5 years ago
I am new to Firefox. I will submit a patch soon.
(Reporter)

Comment 2

5 years ago
Created attachment 734353 [details] [diff] [review]
patch

Fixed warning
Attachment #734353 - Flags: review?(khuey)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 734353 [details] [diff] [review]
patch

Unfortunately, this doesn't work.  The state value is a uint64_t.  Thats' a "long unsigned int" on 64-bit systems, but a "long long unsigned int" on 32-bit systems.  I presume you're compiling on a 64-bit system?

In any case, the %llx format always expects a 64-bit value, so this should in fact end up behaving correctly, which the patched code does not.  :(

The question is how we can suppress the bogus warning...
Attachment #734353 - Flags: review?(khuey) → review-
You need to log in before you can comment on or make changes to this bug.