This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Strange Warnings


Code --------------------------------------------

#include <math.h>

double  TEST_RUN ( unsigned int ms )
{
    static float           A [1000];
    int                    ret = 0;
    size_t                 i;

    ms *= 1000;
    while ( ms-- ) {
        for ( i = 0; i < 1000; i++ )
            ret += (int) floorf (A[i]);                     <------------
    }

    return (double) ret;
}


Warning while compiling -------------------------------

test-0003-inc.c: In function 'test_0003_run':
test-0003-inc.c:12: warning: passing arg 1 of 'floorf' as 'float' rather than 'double' due to prototype
test-0003-inc.c:12: warning: cast does not match function type


Remarks ------------------------------------------------

Warning 1 is not very useful, it is so little useful so that it disturbs.
Warning 2 I do not understand.

-- 
Frank Klemm


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]