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]
Other format: [Raw text]

[PATCH] Re: conversion warnings in c++



-Wconversion is a good idea. I don't think -Wtraditional is relevant.

Here's the patch to implement it. Avoids the warning in this testcase when -Wconversion is not passed on the command line:


int func1(int i)
{
  return i;
}

int main()
{
  float f;
  long l;
  unsigned long ul;

f = 1.5f;

  l = f;
  ul = -1;
  func1(f);

  return 0;
}


OK? Did you want me to add this as a testcase? If so, would you like me to check that it compiles silently by default or that -Wconversion turns the warnings on? :)


-eric

2006-01-12 Eric Christopher <echristo@apple.com>

        * call.c (convert_like_real): When issuing conversion
        warnings, depend on OPT_Wconversion.

Attachment: warning.diff.txt
Description: Text document


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