There exists a conversion from streampos to streamoff, so that the
expression can be interpreted as
=09(streamoff)pos - 1
or
=09pos.operator-(1)
In both cases conversions are used (from streampos to streamoff, and
from int to long). The ambiguouity can be resolved be writing
=09pos - 1L
Probably th
Package: g++
Version: 3.2.3-20030331
If I have the following code:
#include
int foo()
{
std::streampos pos;
pos - 1;
}
When I compile this with "g++ -Wall test.cc", this gives me:
test.cc: In function `int foo()':
test.cc:6: ISO C++ says that `std::fpos<_StateT>
std::fpos<_StateT>::operator
Carlos O'Donell wrote:
int main()
{
int a = 0;
while (a == 0) {
a = 1;
}
while (1)
/* Do nothing */ ;
return 0;
}
The issue is a rather pedantic one. Should an error be generated
by the compiler indicating that 'return 0' can never be reached?
Not an error because the code is in fact c
le (1)
/* Do nothing */ ;
return 0;
}
Regards,
Bart Samwel
Eugene Morozov wrote:
Package: gcc
Version: 2:2.95.4-16
Severity: normal
gcc compiles following program without emitting warning even with
-Wall -ansi -pedantic. gcc-3.2 also compiles this program.
int main()
{
int a = 0;
while (a
4 matches
Mail list logo