https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103531

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org
             Blocks|                            |87403

--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
-Wtraditional-conversion catches this:

$ /usr/local/bin/gcc -c -Wall -Wextra -pedantic -Wconversion -Wdouble-promotion
-Wtraditional-conversion 103531.c
103531.c: In function 'foo':
103531.c:5:30: warning: passing argument 1 of 'ceil' as floating rather than
integer due to prototype [-Wtraditional-conversion]
    5 |     int covers_half = ceil(x / 2);
      |                            ~~^~~
103531.c:5:23: warning: conversion from 'double' to 'int' may change value
[-Wfloat-conversion]
    5 |     int covers_half = ceil(x / 2);
      |                       ^~~~
$


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87403
[Bug 87403] [Meta-bug] Issues that suggest a new warning

Reply via email to