473,836 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

weird compiler warning

I'm compiling some code on a IRIX compiler (MIPSpro Compilers: Version
7.4.2m) with all warnings turned on, and I'm getting some of these warnings:
cc-3649 CC: ERROR at end of source
all virtual functions for class "std::__Named_e xception" inline: static
virtual table generated
cc-3649 CC: ERROR at end of source
all virtual functions for class "std::logic_err or" inline: static virtual
table generated

Anyone have any idea what the heck it means and why it's a problem?

Thanks,
Joe
Aug 2 '06 #1
3 1920
Joe Van Dyk wrote:
I'm compiling some code on a IRIX compiler (MIPSpro Compilers: Version
7.4.2m) with all warnings turned on, and I'm getting some of these warnings:
cc-3649 CC: ERROR at end of source
all virtual functions for class "std::__Named_e xception" inline: static
virtual table generated
cc-3649 CC: ERROR at end of source
all virtual functions for class "std::logic_err or" inline: static virtual
table generated

Anyone have any idea what the heck it means and why it's a problem?

Thanks,
Joe
Many compilers implement virtual functions as follows (note, this is
not required by the standard, but is just a common implementation) :

For each class that has virtual functions, create a table (called
vtable or "virtual table") of pointers to all virtual functions. Add
to the class an additional member that is a pointer to this table.
When dispatching a function virtually, follow the pointer to find the
vtable, find the appropriate function pointer in the vtable, call the
function.

Now, this works well in practice, except for the detail that the
compiler must find some place to actually put this table. A common
heuristic is to put it in the compilation unit that contains the
definition of the class's first non-inline virtual function. Obviously
this doesn't work if there are no non-inline virtual functions, as in
your case.

Faced with this situation, some compilers will use other smart tricks,
and others will generate a separate copy of the vtable in every
compilation in which the class is used, which may possibly increase the
runtime size of your program considerably. My guess is that your
compiler chooses this latter route, and is warning you about it.

The obvious solution is to not have any classes in which all virtual
functions are inlined. Such a concept is rarely useful anyway. A call
to a virtual function can only be inlined if the static type is known,
in which case why did you make the function virtual?

--
Alan Johnson

Aug 3 '06 #2

"Alan Johnson" <aw***@yahoo.co mskrev i meddelandet
news:11******** *************@i 3g2000cwc.googl egroups.com...
Joe Van Dyk wrote:
>I'm compiling some code on a IRIX compiler (MIPSpro Compilers:
Version
7.4.2m) with all warnings turned on, and I'm getting some of these
warnings:
cc-3649 CC: ERROR at end of source
all virtual functions for class "std::__Named_e xception" inline:
static
virtual table generated
cc-3649 CC: ERROR at end of source
all virtual functions for class "std::logic_err or" inline:
static virtual
table generated

The obvious solution is to not have any classes in which all virtual
functions are inlined. Such a concept is rarely useful anyway. A
call
to a virtual function can only be inlined if the static type is
known,
It might be known in some contexts, but not in others. Sometimes you
use an object directly, sometimes through a pointer or reference.
in which case why did you make the function virtual?
He didn't.

It's part of the standard library. .-)
Bo Persson
Aug 3 '06 #3
On Thu, 03 Aug 2006 19:54:21 +0200, Bo Persson wrote:
>
"Alan Johnson" <aw***@yahoo.co mskrev i meddelandet
news:11******** *************@i 3g2000cwc.googl egroups.com...
>Joe Van Dyk wrote:
>>I'm compiling some code on a IRIX compiler (MIPSpro Compilers:
Version
7.4.2m) with all warnings turned on, and I'm getting some of these
warnings:
cc-3649 CC: ERROR at end of source
all virtual functions for class "std::__Named_e xception" inline:
static
virtual table generated
cc-3649 CC: ERROR at end of source
all virtual functions for class "std::logic_err or" inline:
static virtual
table generated

>The obvious solution is to not have any classes in which all virtual
functions are inlined. Such a concept is rarely useful anyway. A
call
to a virtual function can only be inlined if the static type is
known,

It might be known in some contexts, but not in others. Sometimes you
use an object directly, sometimes through a pointer or reference.
>in which case why did you make the function virtual?

He didn't.

It's part of the standard library. .-)
Yes, so this warning is frustrating me. I don't see a way to turn off
that particular warning either.

Joe

Aug 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
3594
by: Bo | last post by:
When I had this code, a and b's value never increases. for( int i=0, double a=0.0, double b=0.0 ; i<100; a+=0.1, b+=0.2 ) { printf( "%s\n", i+a+b ); } This works, however: double a=0.0, b=0.0;
1
2790
by: amit | last post by:
I am trying to compile the sample program genwin.sqc, using nsqlprep which is used to precompile embedded sql in C. I am getting weird errors and that is because windows.h is included in the genwin.sqc file. I am using Setting the lib and include path: set INCLUDE=C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\include;C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Samples\esqlc;%include%
1
3194
by: Hafeez | last post by:
I am having real trouble compiling this code http://www.cs.wisc.edu/~vganti/birchcode/codeHier/AttrProj.tgz The attachment shows errors when compiled using the current version of g++ in a i386-pc-solaris2.9. Seeing reference to gcc-2.7.2 in the Makefile of the code, I downloaded it and compiled in my home directory. Then changed the referenes of LIBDIR and INCLUDES to this installation .and ran with g++ for 2.7.2 then there are still...
11
1604
by: Ross | last post by:
I'm compiling some code over and over with no problems. The only differences between the versions is slightly different constants that are specific to various embedded devices that are getting loaded. Suddenly I notice a certain value generates a warning. Here's the low-down: The specific instance of the "-6" in this phrase generates a warning: const signed long tzerocal_A ={80000, 15000, -60000 }; //bad
8
1540
by: Daniel Yelland | last post by:
Hi, I have developed a number of code libraries in Win32 DLLs and have written a number of test suite executables that implicitly link to these libraries in order to test them. In one of my test applications, which runs fine in Debug mode, it is crashing in the destructor of a local object on the stack when it is built in release mode. An example of the C++ that causes the problem is as follows (apologies for the contrived example): -
1
1358
by: Josué Andrade Gomes | last post by:
Take this code: 1: int main() 2: { 3: unsigned short x = { 1, 2, 3, 4, 5 }; 4: unsigned short sum = 0; 5: 6: for (int i = 0; i < 5; ++i) { 7: sum += x; 8: } 9: }
13
2694
by: Sam Steingold | last post by:
the following program does not compile with g++ 4.1.1: ==================================================== // $Id$ // $Source$ #include <stdint.h> #include <stdio.h> typedef struct { uint32_t one_c; } chart; #define as_chart(c) ((chart){one_c:(c)})
14
2729
by: WStoreyII | last post by:
the following code is supposed to read a whole line upto a new line char from a file. however it does not work. it is producing weird results. please help. I had error checking in there for mallocs and ect, but i removed them to help me debug. thanks. #include <stdio.h> #include <stdlib.h> #include <string.h> void freadl ( FILE *stream, char **string ) {
2
3077
by: greg | last post by:
In my quest to eliminate C compiler warnings from Pyrex output, I've discovered some utterly bizarre behaviour from gcc 3.3. The following code: void g(struct foo *x) { } void f(void) {
0
9674
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10860
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10560
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10604
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10261
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6984
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5659
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5831
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.