Closed Bug 1167995 Opened 4 years ago Closed Last year

B2G Build warning: MediaCodecProxy.h:48:23: warning: multi-character character constant [-Wmultichar], for enum kKeyBufferIndex = 'bfin'

Categories

(Core :: Audio/Video: Playback, defect)

defect
Not set

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox41 --- affected

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Noticed while building B2G:
{
In file included from ../../dist/include/MediaCodecReader.h:23:0,
                 from ../../../gecko/dom/media/DecoderTraits.cpp:48:
../../dist/include/MediaCodecProxy.h:48:23: warning: multi-character character constant [-Wmultichar]
}

That's pointing to this code:
> 47   enum {
> 48     kKeyBufferIndex = 'bfin',
> 49   };

Note the single-quotes there (which are normally used for single characters).

According to the top answer here...
https://stackoverflow.com/questions/7755202/multi-character-constant-warnings
...this is technically valid, but not really portable (and the actual value of the constant is up to the compiler).

Unless we actually need this enum value to have this multi-character value for some reason (which I doubt we do), we should probably just drop the explicit value...?
Blake?
Flags: needinfo?(bwu)
The reason I use this multi-character value is Android use it in a Keyed Vector in storing MetaData[1] and I add one more key for some purpose. If I just assign a number instead of using multi-character, there is a chance that my assigned value might be conflict with those values defined by multi-character in MetaData. 

[1]http://androidxref.com/4.4.4_r1/xref/frameworks/av/include/media/stagefright/MetaData.h#32
Flags: needinfo?(bwu)
Component: Audio/Video → Audio/Video: Playback
Using multi-character constants for enum values is the coding style of Android's Stagefright API. I think we should permit these multi-character constants in Gecko code that interfaces with Stagefright and OMX code.

We can "fix" this warning by suppressing it in moz.build or globally in configure.in. I suppressed some other -Wmultichar warnings in Stagefright code in bug 861601.
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.