This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/26298] New: no warning for implicit type conversion


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


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