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]

GCC -O error?


Hi,

I am using GCC version 4.3.0 on Linux FC 9. I found following a wired situation:

In a test.cpp there is a statement:

uint16_t so = ::htons(a); // line 168

It compiled fine if I use -g. But when I changed the -g to -O, it
broken to errors:

g++  -O -Wall -Wundef -Wabi -Wextra -Wunused -Wconversion   -c -o
test.o test.cpp

test.cpp:168: error: expected id-expression before '(' token
test.cpp:168: warning: conversion to 'short unsigned int' from 'int'
may alter its value

Is it a bug, or what I am missing here?

Thank you.

Kind Regards,

Sean


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