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]

Re: char* problems


On Wed, Sep 24, 2008 at 2:47 AM, Lijuan Hai <hailijuan@gmail.com> wrote:
> I have no gcc 4.1.2 at hand. but I just had a try with gcc-4.1.0 and
> gcc-4.2.0 which compiled a simple testcase with no errors or warnings.
> additionally, I had a try with some other compiler than gcc to compile
> it. a warning issued.
> I think it's possibly too strict of gcc raising a error on sch case.
> any options that you added when compiling?

Well lets put it this way, this is invalid code as char, signed char,
and unsigned char are three distant types so the pointers to each of
them are not compatible which means you need an explicit cast.

The C++ compiler errors out by default, you can change the error to a
warning with -fpermissive.
While the C front-end warns by default, you can change the warning to
an error with -pedantic-errors.

Thanks,
Andrew Pinski


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