The following code gives two different results without any warning:

#include <stdio.h>

void toInt(int i)
{
  fprintf(stderr, "i = %d\n", i);
}

void toLongLong(long long L)
{
  fprintf(stderr, "L = %lld\n", L);
}

int main()
{
  toInt(-sizeof(int));
  toLongLong(-sizeof(int));

  return 0;
}

There should at least be a warning.
This behaviour can be found on SUN and on Linux x86 with compiler versions
between 3.4.4 and 4.0.3 (prerelease).


-- 
           Summary: no warning for implicit type conversion
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: m dot becker at spider-software dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26298

Reply via email to