How stupid can a compiler be?!

J

JKop

Today I wrote a function that returned an "std::eek:stringstream" by value.

I compiled it with G++.

It was throwing exceptions at run-time and closing.

So I look through the code, and I look and I look...

I forgot to put in the return statement in the aforementioned funtion, ie.
it had no return statement.

How the hell does this compile?! Does the Standard "allow" this to compile?

What exactly would my function return, a nameless default object, ie.
std::eek:stringstream()?

-JKop
 
A

Andre Kostur

Today I wrote a function that returned an "std::eek:stringstream" by
value.

I compiled it with G++.

It was throwing exceptions at run-time and closing.

So I look through the code, and I look and I look...

I forgot to put in the return statement in the aforementioned funtion,
ie. it had no return statement.

To turn around the title.... "How silly can a programmer be, do declare a
function and not bother to return anything?"
How the hell does this compile?! Does the Standard "allow" this to
compile?

What exactly would my function return, a nameless default object, ie.
std::eek:stringstream()?

Who knows (other than the compiler writers). However, I'd suggest that you
turn on as many of the compilier diagnostics that you can (like -Wall). I
know that g++ will warn you about control reaching the end of a non-void
function.
 
J

JKop

To turn around the title.... "How silly can a programmer be, do declare
a function and not bother to return anything?"

I was focusing all my attention on making the object ready
to be returned, then I simply *forgot* to type:

return blah;


....I think there may be some other problem though to do
with macros (I've got "windows.h" included). I'm get all
sorts of weird compiler errors, possibly some macros are
inteferring with the names of functions, variables, classes
I've declare.

MACROS WILL DIE.


-JKop
 
I

Ioannis Vranos

JKop said:
...I think there may be some other problem though to do
with macros (I've got "windows.h" included). I'm get all
sorts of weird compiler errors, possibly some macros are
inteferring with the names of functions, variables, classes
I've declare.

MACROS WILL DIE.


Did you install the latest MINGW package? If yes, these are the compiler
options that are good to use:

-std=c++98 -pedantic-errors -Wall -fexpensive-optimizations -O3
-ffloat-store -mcpu=pentiumpro
 
J

JKop

I've found my problem.

Please pick your favourite compiler and compile the following:

#include <string>
#include <sstream>
#include <iostream>

std::eek:stringstream Blah()
{
std::eek:stringstream gagaa;

gagaa << 5;

gagaa << "Hello!";

return gagaa;

}

int main()
{
Blah();
}



BRACE YOURSELF...



T:\Projects\IftC>g++ test.cpp -ansi -pedantic -o test.exe
t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424: `std::ios_base::ios_base
(const
std::ios_base&)' is private
test.cpp:13: within this context
t:/mingw/include/c++/3.2.3/streambuf: In copy constructor
::basic_stringbuf(const std::basic_stringbuf<char, std::char_traits
<char>,
std::allocator<char> >&)':
t:/mingw/include/c++/3.2.3/streambuf:479: `std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&)
[with _CharT = char, _Traits = std::char_traits<char>]' is private
test.cpp:13: within this context


-JKop
 
I

Ioannis Vranos

JKop said:
I've found my problem.

Please pick your favourite compiler and compile the following:

#include <string>
#include <sstream>
#include <iostream>

std::eek:stringstream Blah()
{
std::eek:stringstream gagaa;

gagaa << 5;

gagaa << "Hello!";

return gagaa;

}

int main()
{
Blah();
}



BRACE YOURSELF...



T:\Projects\IftC>g++ test.cpp -ansi -pedantic -o test.exe
t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424: `std::ios_base::ios_base
(const
std::ios_base&)' is private
test.cpp:13: within this context
t:/mingw/include/c++/3.2.3/streambuf: In copy constructor
::basic_stringbuf(const std::basic_stringbuf<char, std::char_traits
<char>,
std::allocator<char> >&)':
t:/mingw/include/c++/3.2.3/streambuf:479: `std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&)
[with _CharT = char, _Traits = std::char_traits<char>]' is private
test.cpp:13: within this context


Here's the result of VC++ 2005 Express Beta:


C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40904
for Microsoft (R) .NET Framework version 2.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.

temp.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\include\sstream(444) :
error C2248
: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private
member decl
ared in class 'std::basic_ios<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\ios(147)
: see dec
laration of 'std::basic_ios<_Elem,_Traits>::basic_ios'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
This diagnostic occurred in the compiler generated function
'std::basic_
ostringstream<_Elem,_Traits,_Alloc>::basic_ostringstream(const
std::basic_ostrin
gstream<_Elem,_Traits,_Alloc> &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Alloc=std::allocator<char>
]

C:\c>
 
I

Ioannis Vranos

Ioannis said:
JKop said:
I've found my problem.

Please pick your favourite compiler and compile the following:

#include <string>
#include <sstream>
#include <iostream>

std::eek:stringstream Blah()
{
std::eek:stringstream gagaa;
gagaa << 5;
gagaa << "Hello!";
return gagaa;

}

int main()
{
Blah();
}



BRACE YOURSELF...



T:\Projects\IftC>g++ test.cpp -ansi -pedantic -o test.exe
t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424: `std::ios_base::ios_base
(const
std::ios_base&)' is private
test.cpp:13: within this context
t:/mingw/include/c++/3.2.3/streambuf: In copy constructor
`std::basic_stringbuf said:
::basic_stringbuf(const std::basic_stringbuf<char, std::char_traits
<char>,
std::allocator<char> >&)':
t:/mingw/include/c++/3.2.3/streambuf:479: `std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT,
_Traits>&)
[with _CharT = char, _Traits = std::char_traits<char>]' is private
test.cpp:13: within this context



Here's the result of VC++ 2005 Express Beta:



However since standard library hasn't been made CLI friendly yet, those
were not the appropriate error messages. Here they are:



C:\c>cl temp.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.40904 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

temp.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(315) :
warning C45
30: C++ exception handler used, but unwind semantics are not enabled.
Specify /E
Hsc
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(329) :
warning C45
30: C++ exception handler used, but unwind semantics are not enabled.
Specify /E
Hsc
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(346) :
warning C45
30: C++ exception handler used, but unwind semantics are not enabled.
Specify /E
Hsc
C:\Program Files\Microsoft Visual Studio 8\VC\include\istream(1062) :
warning C4
530: C++ exception handler used, but unwind semantics are not enabled.
Specify /
EHsc
C:\Program Files\Microsoft Visual Studio 8\VC\include\sstream(444) :
error C2248
: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private
member decl
ared in class 'std::basic_ios<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\ios(147)
: see dec
laration of 'std::basic_ios<_Elem,_Traits>::basic_ios'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
This diagnostic occurred in the compiler generated function
'std::basic_
ostringstream<_Elem,_Traits,_Alloc>::basic_ostringstream(const
std::basic_ostrin
gstream<_Elem,_Traits,_Alloc> &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Alloc=std::allocator<char>
]

C:\c>
 
J

JKop

Ioannis Vranos posted:
JKop said:
I've found my problem.

Please pick your favourite compiler and compile the following:

#include <string>
#include <sstream>
#include <iostream>

std::eek:stringstream Blah()
{
std::eek:stringstream gagaa;

gagaa << 5;

gagaa << "Hello!";

return gagaa;

}

int main()
{
Blah();
}



BRACE YOURSELF...



T:\Projects\IftC>g++ test.cpp -ansi -pedantic -o test.exe
t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424:
`std::ios_base::ios_base (const
std::ios_base&)' is private
test.cpp:13: within this context
t:/mingw/include/c++/3.2.3/streambuf: In copy constructor
`std::basic_stringbuf said:
::basic_stringbuf(const std::basic_stringbuf<char,
::std::char_traits <char>, std::allocator<char> >&)':
t:/mingw/include/c++/3.2.3/streambuf:479:
`std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT,
_Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]'
is private test.cpp:13: within this context


Here's the result of VC++ 2005 Express Beta:


C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40904
for Microsoft (R) .NET Framework version 2.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.

temp.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\include\sstream(444) :
error C2248
: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private
member decl
ared in class 'std::basic_ios<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\ios(147)
: see dec
laration of 'std::basic_ios<_Elem,_Traits>::basic_ios'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
This diagnostic occurred in the compiler generated function
'std::basic_
ostringstream<_Elem,_Traits,_Alloc>::basic_ostringstream(const
std::basic_ostrin
gstream<_Elem,_Traits,_Alloc> &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Alloc=std::allocator<char>
]

C:\c>

English please...


I'm a bit confused, but are our compilers telling us that there's errors in
the standard header files? The *Standard* header files?

Some-one...


-JKop
 
J

JKop

***********************************************************
I've upgraded to the brand spankin' newest version of G++.
**********************************************************

Here we go:


T:\Projects\IftC>g++ test.cpp -std=c++98 -pedantic-errors -Wall -fe
xpensive-optimizations -O3 -ffloat-store -mcpu=pentiumpro -o t.exe
t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424: `std::ios_base::ios_base
(const
std::ios_base&)' is private
test.cpp:13: within this context
t:/mingw/include/c++/3.2.3/streambuf: In copy constructor
::basic_stringbuf(const std::basic_stringbuf<char, std::char_traits
<char>,
std::allocator<char> >&)':
t:/mingw/include/c++/3.2.3/streambuf:479: `std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&)
[with _CharT = char, _Traits = std::char_traits<char>]' is private
test.cpp:13: within this context



What
the
hell
is
going
on?
?
?
?
?


-JKop
 
I

Ioannis Vranos

JKop said:
English please...


I'm a bit confused, but are our compilers telling us that there's errors in
the standard header files? The *Standard* header files?

Some-one...


-JKop


As far as I could see it has not a copy constructor. TC++PL uses this
somewhere:


"For example, an ostringstream can be used to format message strings:

extern const char* std_ message[] ;

string compose(int n, const string& cs)
{
ostringstream ost;

ost << "error(" << n << ") " << std_ message[n] << " (user comment:
" << cs << ´)´;

return ost.str() ;
}

There is no need to check for overflow because ost is expanded as
needed. This technique can be most useful for coping with cases in which
the formatting required is more complicated than what is common for a
line-oriented output device.

An initial value can be provided for an ostringstream, so we could
equivalently have written:

string compose2(int n, const string& cs)
{
ostringstream ost("error(") ;
ost << n << ") " << std_ message[n] << " (user comment: " << cs << ´)´;

return ost.str() ;
}"
 
A

Andre Kostur

I've found my problem.

Please pick your favourite compiler and compile the following:

#include <string>
#include <sstream>
#include <iostream>

std::eek:stringstream Blah()
{
std::eek:stringstream gagaa;

gagaa << 5;

gagaa << "Hello!";

return gagaa;

}

int main()
{
Blah();
}



BRACE YOURSELF...

Nope... rhetorical question:

What does it mean to copy a stream?

According to the book "Standard C++ IOStreams and Locales" by Langer &
Kreft, they state that "Streams can neither be copied nor assigned,
because the copy constructor and copy assignment operator are
inaccessable." (section 27.4.4 of the Standard seems to agree...)
 
A

Andre Kostur

***********************************************************
I've upgraded to the brand spankin' newest version of G++.
**********************************************************

Here we go:


T:\Projects\IftC>g++ test.cpp -std=c++98 -pedantic-errors -Wall -fe
xpensive-optimizations -O3 -ffloat-store -mcpu=pentiumpro -o t.exe
t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424:
`std::ios_base::ios_base (const
std::ios_base&)' is private
test.cpp:13: within this context
t:/mingw/include/c++/3.2.3/streambuf: In copy constructor
`std::basic_stringbuf said:
::basic_stringbuf(const std::basic_stringbuf<char, std::char_traits
<char>,
std::allocator<char> >&)':
t:/mingw/include/c++/3.2.3/streambuf:479:
`std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT,
_Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]'
is private
test.cpp:13: within this context

Ahhhh.. simple to read! (Yes, I'm being sarcastic.....) "STL" error
messages are notorious for being rather, um, verbose. You may wish to
look for a project called stlfilt which simplifies many of the error
messages. However, if you read the lines above (and kinda gloss over a
bunch of the template expansion stuff), you'll end up with:

t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<>::basic_ios(const std::basic_ios<>&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424:
`std::ios_base::ios_base (const std::ios_base&)' is private
test.cpp:13: within this context

So, in a particular copy constructor, one of it's base-class' copy
constructors is private, which is intended to prevent you from making any
copies (which is exactly what it's doing).
 
K

Kai-Uwe Bux

JKop said:
***********************************************************
I've upgraded to the brand spankin' newest version of G++.
**********************************************************

Here we go:


T:\Projects\IftC>g++ test.cpp -std=c++98 -pedantic-errors -Wall -fe
xpensive-optimizations -O3 -ffloat-store -mcpu=pentiumpro -o t.exe
t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424: `std::ios_base::ios_base
(const
std::ios_base&)' is private
test.cpp:13: within this context
t:/mingw/include/c++/3.2.3/streambuf: In copy constructor
`std::basic_stringbuf said:
::basic_stringbuf(const std::basic_stringbuf<char, std::char_traits
<char>,
std::allocator<char> >&)':
t:/mingw/include/c++/3.2.3/streambuf:479: `std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&)
[with _CharT = char, _Traits = std::char_traits<char>]' is private
test.cpp:13: within this context



What
the
hell
is
going
on?
?
?
?
?


-JKop

std::eek:stringstream has a private copy constructor to prevent copying. My
understanding is that it would hurt performance if stream objects (which
are quite stateful) had to be designed so that they can be copied.
Moreover, what would the semantics of a stream assignment be?

Anyway, the return statement in Blah() wants to copy a local variable to
the outside world. That's where it fails.

Just for fun, you might try this:

#include <iostream>
int main() {
std::eek:stringstream x, y;
x = y;
}

It fails badly because the assignment operator is also private.


Best

Kai-Uwe Bux
 
G

Gregg

Ioannis Vranos posted:

English please...


I'm a bit confused, but are our compilers telling us that there's
errors in the standard header files? The *Standard* header files?

No, did you read the error message:

This says that you are trying to invoke a private ios_base copy
constructor on line 13 of test.cpp.

The ios_base class is the base class of stream classes, including
ostringstream. Since the copy constructor for ios_base is private, so is
it for ostringstream.

Since it is private, you cannot copy anything derived from ios_base,
including ostringstream. You are attempting to do this when you return
one by value in Blah.

Gregg
 
O

Old Wolf

JKop said:
Today I wrote a function that returned an "std::eek:stringstream" by value.

Bad start already, you can't return streams by value.
To save me the effort of replying to your other post, the compiler
was complaining that the stream's copy-constructor was private
(which is the method used by the standard library to prevent you
from copying streams by value).
I compiled it with G++.

It was throwing exceptions at run-time and closing.

So I look through the code, and I look and I look...

I forgot to put in the return statement in the aforementioned funtion, ie.
it had no return statement.

How the hell does this compile?! Does the Standard "allow" this to compile?

Failing to return from a non-void function invokes undefined
behaviour, no diagnostic required. Requiring a diagnostic would
place undue pressure on compiler developers, eg. the following
code should not generate a diagnostic:

int foo()
{
for(;;) { bar(); }
}

Should the following generate a diagnostic?

int foo()
{
int x = 1947;
while (x)
if (x % 2) x = 3 * x + 1; else x /= 2;
}
What exactly would my function return, a nameless default object, ie.
std::eek:stringstream()?

Undefined. Probably the calling function would go through the
motions of reading whatever memory it would expect the object
to have been returned in, but get garbage out of that memory.
 
P

Peter Koch Larsen

JKop said:
I've found my problem.

Please pick your favourite compiler and compile the following:

#include <string>
#include <sstream>
#include <iostream>

std::eek:stringstream Blah()
{
std::eek:stringstream gagaa;

gagaa << 5;

gagaa << "Hello!";

return gagaa;

}

int main()
{
Blah();
}



BRACE YOURSELF...



T:\Projects\IftC>g++ test.cpp -ansi -pedantic -o test.exe
t:/mingw/include/c++/3.2.3/bits/ios_base.h: In copy constructor
`std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)':
t:/mingw/include/c++/3.2.3/bits/ios_base.h:424: `std::ios_base::ios_base
(const
std::ios_base&)' is private
test.cpp:13: within this context
t:/mingw/include/c++/3.2.3/streambuf: In copy constructor
`std::basic_stringbuf<char, std::char_traits<char>,
std::allocator said:
::basic_stringbuf(const std::basic_stringbuf<char, std::char_traits
<char>,
std::allocator<char> >&)':
t:/mingw/include/c++/3.2.3/streambuf:479: `std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&)
[with _CharT = char, _Traits = std::char_traits<char>]' is private
test.cpp:13: within this context


-JKop

Very clear. The copy constructor could not be created - std::basic_ios has a
private constructor. What is the problem?

/Peter
 
P

Peter Koch Larsen

JKop said:
Ioannis Vranos posted:
JKop said:
I've found my problem.
[snip]

Here's the result of VC++ 2005 Express Beta:


C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40904
for Microsoft (R) .NET Framework version 2.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.

temp.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\include\sstream(444) :
error C2248
: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private
member decl
ared in class 'std::basic_ios<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\ios(147)
: see dec
laration of 'std::basic_ios<_Elem,_Traits>::basic_ios'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
This diagnostic occurred in the compiler generated function
'std::basic_
ostringstream<_Elem,_Traits,_Alloc>::basic_ostringstream(const
std::basic_ostrin
gstream<_Elem,_Traits,_Alloc> &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Alloc=std::allocator<char>
]

C:\c>

English please...


I'm a bit confused, but are our compilers telling us that there's errors in
the standard header files? The *Standard* header files?

Some-one...

The same diagnostic as your compiler. See my other post.

/Peter
 
G

Gernot Frisch

JKop said:
Today I wrote a function that returned an "std::eek:stringstream" by
value.

I compiled it with G++.

It was throwing exceptions at run-time and closing.

So I look through the code, and I look and I look...

I forgot to put in the return statement in the aforementioned
funtion, ie.
it had no return statement.

How the hell does this compile?! Does the Standard "allow" this to
compile?

What exactly would my function return, a nameless default object,
ie.
std::eek:stringstream()?

-JKop

Is the problem already solved now?
 
J

JKop

Thanks for all the responses.


Here's my rememdy:


std::string Blah()
{
std::eek:stringstream blah;

return blah.str();
}


-JKop
 
I

Ioannis Vranos

Old said:
Failing to return from a non-void function invokes undefined
behaviour, no diagnostic required.


Canyou please point me where it is mentioned in the standard?



Requiring a diagnostic would
place undue pressure on compiler developers, eg. the following
code should not generate a diagnostic:

int foo()
{
for(;;) { bar(); }
}


If you mean by design, why not?


For the simplest code:

int f() {}


int main()
{
}


G++ produces:


temp.cpp: In function `int f()':
temp.cpp:1: warning: no return statement in function returning non-void
temp.cpp:1: warning: control reaches end of non-void function





and VC++ 2005 Express Beta 1:


C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40904
for Microsoft (R) .NET Framework version 2.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.

temp.cpp
c:\c\temp.cpp(1) : error C4716: 'f' : must return a value

C:\c>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,489
Latest member
BrigidaD91

Latest Threads

Top