Langage C.
Comment faire pour que code blocks et GNU MingW affiche des warnings quand j'essaie de stocker un nombre dans un type de variable trop petit ou trop grand pour le recevoir.
Voici un exemple
Quand je stocke -20000000000 dans un entier non signé (int) il affiche
warning: integer constant is too large for long type
warning: overflow in implicit constant conversion.
Alors que dans le cas ou je stocke -2000000000 dans (int) il n'affiche plus rien.
Partager