antirez / antirez/sds

Potential undefined behavior when negating value in sdsll2str

Ouverte
#90 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C
Étoiles
5.6k
Forks
510
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

When compiling with [UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) and running the tests (`CC=clang-6.0 CFLAGS='-fsanitize=undefined'`, the following error is raised:

```
[...]
6 - sdscatprintf() seems working in the base case: PASSED
sds.c:446:23: runtime error: negation of -9223372036854775808 cannot be represented
in type 'long long'; cast to an unsigned type to negate this value to itself
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior sds.c:446:23 in
[...]
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.