Suspicious shift
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with basisu.h around line 310 and inspect the NumBytes == 8 conversion alongside the other switch cases. Check the return type and the iOS arm64 clang warning to determine whether the shift is intentional or loses required data. Done means the conversion behavior is correct and the reported warning is resolved.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In basisu.h at line 310 is
inline operator uint32_t() const
{
switch (NumBytes)
{
...
case 8:
{
uint32_t l = read_le_dword(m_bytes);
uint32_t h = read_le_dword(m_bytes + 4);
return static_cast<uint64_t>(l) | (static_cast<uint64_t>(h) << 32U); <=========
}
...
}
}
When compiling for iOS arm64, the latest Xcode/clang (13.5 / 13.1.6) throws an implicit conversion loses integer precision warning which drew my attention to the highlighted line. This line looks extremely suspicious because the shift of h by 32-bits is throwing away the value of h in so far as the 32-bit return value will never see it. Many other cases also return a value that is statically cast to 64-bits which seems pointless as the return value is uint32_t. There is no warning on those cases.
If the highlighted line is truly correct, please add additional casts to fix the warnings, otherwise fix the code.
- Lingua principale
- C++
- Stelle
- 3.1k
- Fork
- 347
- Merge medio
- 4g 3h
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di BinomialLLC/basis_universal
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BinomialLLC/basis_universal#476 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
BinomialLLC/basis_universal#471 · 1 commento · 1 reazione ·
-
ktx2_transcoder::transcode_image_level asserts on a malformed uncompressedByteLength instead of returning falseForse già presa @albertrodriguezclo l’ha presa 24 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
BinomialLLC/basis_universal#472 · 2 commenti · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
BinomialLLC/basis_universal#465 ·
-
Support custom key/value pairs in KTX2 compressionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 54/100
BinomialLLC/basis_universal#454 · 1 commento ·
Tutte le issue di BinomialLLC/basis_universal
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
-
area:qmc bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 3 giorni
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
ASGC-Game-Jam/asgc-gamejam-2026#563 ·
I maintainer di solito rispondono entro 1 giorno
-
area/ysql kind/bug priority/medium status/awaiting-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
yugabyte/yugabyte-db#37523 ·
I maintainer di solito rispondono entro 1 giorno
-
Let agents name their jobsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100