Open
Bug 1072317
Opened 10 years ago
Updated 2 years ago
numerous instances of warning C4334 '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
NEW
People
(Reporter: froydnj, Unassigned)
References
(Blocks 1 open bug)
Details
This warning appears to be unhelpful; the warnings seem to be triggered by code like: (1 << mPaletteDepth) * sizeof(uint32_t); // imgFrame.h or: cost[0][1 << i] = ... // opus_encoder.c, cost is a float[][] or: bin->reg_size = (1U << (TINY_MIN_2POW + i)); // jemalloc.c In all these cases, relying on the implicit upcast to a wider type is intended and desirable. I think we should disable the warning.
Comment 1•10 years ago
|
||
Why not make those casts explicit instead. I've seen sec bugs in the past due to bit shifting mistakes.
Reporter | ||
Comment 2•10 years ago
|
||
(In reply to Justin Wood (:Callek) from comment #1) > Why not make those casts explicit instead. I've seen sec bugs in the past > due to bit shifting mistakes. Are they sec bugs because of upcasts to a wider type, or were they sec bugs because of off-by-one errors or something else?
Flags: needinfo?(bugspam.Callek)
Comment 3•10 years ago
|
||
iirc it was off-by-one errors, specifically conversions that were intended to either have a dropped leftmost bit due to the shift. Or even things that don't realize they are being converted and are stored in memory allocated for 32 bits, etc. etc. No concrete bugs to point at though.
Flags: needinfo?(bugspam.Callek)
Updated•6 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•