Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #97258

Re: Negative effects of c++ in C

From Noob <root@127.0.0.1>
Newsgroups comp.lang.c
Subject Re: Negative effects of c++ in C
Date 2016-11-22 15:29 +0100
Organization A noiseless patient Spider
Message-ID <o11kn5$tqs$1@dont-email.me> (permalink)
References <o1160t$a5q$1@dont-email.me> <o117lb$fg5$1@dont-email.me> <o11i9t$kqh$1@dont-email.me>

Show all headers | View raw


On 22/11/2016 14:48, jacobnavia wrote:
> Le 22/11/2016 à 11:46, Noob a écrit :
>> On 22/11/2016 11:18, jacobnavia wrote:
>>
>>> Since most C compilers are just c++ compilers that also compile C, they
>>> generate all the tables needed for exception handling even if the file
>>> is a C file. For instance in a moderately sized program (1.5MB) fully
>>> approx 100 000 bytes are just exception handling tables needed for c++
>>> even if the program is C only!
>>
>> You're talking about Microsoft Visual Studio, right?
> 
> No, I am talking about gcc. For instance I have a program called "asm",
> an assembler, featuring
> 
> jacob@linux-mint ~/lcc/asm/asm4 $ ls -l asm
> -rwxrwxr-x 1 jacob jacob 1462480 Nov 22 14:40 asm
> jacob@linux-mint ~/lcc/asm/asm4 $ objdump -h asm
> 
> asm:     file format elf64-x86-64
> 
> Sections:
> Idx Name          Size
>   0 .interp       0000001c
> ...
> several other small sections elided
> ...
> 15 .eh_frame_hdr 00003734
> 16 .eh_frame     00015b5c
> 
> We have then 0x3734 (14132) and 0x15b5c (88924) bytes, i.e. 103,506
> bytes of exception handling overhead!
> 
> ALL the sources are in straight C and I have to pay 103,506 c++ taxes!
> 
> For NOTHING since C has no throws!

Try compiling the entire project with -fno-asynchronous-unwind-tables

Does that help? :-)

https://stackoverflow.com/questions/26300819/why-gcc-compiled-c-program-needs-eh-frame-section#answer-26302715

Regards.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Negative effects of c++ in C jacobnavia <jacob@jacob.remcomp.fr> - 2016-11-22 11:18 +0100
  Re: Negative effects of c++ in C Noob <root@127.0.0.1> - 2016-11-22 11:46 +0100
    Re: Negative effects of c++ in C jacobnavia <jacob@jacob.remcomp.fr> - 2016-11-22 14:48 +0100
      Re: Big main() "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-11-22 21:51 +0800
      Re: Negative effects of c++ in C Noob <root@127.0.0.1> - 2016-11-22 15:29 +0100
      Re: Negative effects of c++ in C antispam@math.uni.wroc.pl - 2016-11-22 15:09 +0000
    Re: Negative effects of c++ in C jacobnavia <jacob@jacob.remcomp.fr> - 2016-11-22 16:58 +0100
  Re: Negative effects of c++ in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-11-22 14:29 +0000
    Re: Negative effects of c++ in C David Brown <david.brown@hesbynett.no> - 2016-11-22 15:58 +0100
      Re: Negative effects of c++ in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-11-22 15:55 +0000
      Re: Negative effects of c++ in C jacobnavia <jacob@jacob.remcomp.fr> - 2016-11-22 17:01 +0100
        Re: Negative effects of c++ in C Noob <root@127.0.0.1> - 2016-11-22 18:32 +0100
        Re: Negative effects of c++ in C David Brown <david.brown@hesbynett.no> - 2016-11-23 00:19 +0100
  [OT] It's only words... :) "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-11-22 22:55 +0800
    Re: [OT] It's only words... :) "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-11-22 22:57 +0800
  Re: Negative effects of c++ in C Ian Collins <ian-news@hotmail.com> - 2016-11-23 08:43 +1300
    Re: Negative effects of c++ in C jacobnavia <jacob@jacob.remcomp.fr> - 2016-11-22 21:14 +0100
    Re: Negative effects of c++ in C jacobnavia <jacob@jacob.remcomp.fr> - 2016-11-22 21:17 +0100
  Re: Negative effects of c++ in C rockbrentwood@gmail.com - 2016-11-23 15:41 -0800
    Re: Negative effects of c++ in C supercat@casperkitty.com - 2016-11-23 16:19 -0800
      Re: Negative effects of c++ in C David Brown <david.brown@hesbynett.no> - 2016-11-24 14:06 +0100
        Re: Negative effects of c++ in C supercat@casperkitty.com - 2016-11-24 07:36 -0800
          Re: Negative effects of c++ in C David Brown <david.brown@hesbynett.no> - 2016-11-25 00:23 +0100
            Re: Negative effects of c++ in C supercat@casperkitty.com - 2016-11-25 09:42 -0800
    Re: Negative effects of c++ in C Keith Thompson <kst-u@mib.org> - 2016-11-23 16:34 -0800
      Re: Negative effects of c++ in C David Brown <david.brown@hesbynett.no> - 2016-11-24 14:55 +0100

csiph-web