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


Groups > comp.lang.c > #385798

Re: C23 thoughts and opinions

From Michael S <already5chosen@yahoo.com>
Newsgroups comp.lang.c
Subject Re: C23 thoughts and opinions
Date 2024-06-09 20:00 +0300
Organization A noiseless patient Spider
Message-ID <20240609200014.000014be@yahoo.com> (permalink)
References (18 earlier) <v42cs4$2pjrh$1@dont-email.me> <20240609124032.00004eb1@yahoo.com> <v43vkr$3d7el$1@dont-email.me> <20240609141239.00006be6@yahoo.com> <v44lf7$3kpef$1@dont-email.me>

Show all headers | View raw


On Sun, 9 Jun 2024 17:32:40 +0100
bart <bc@freeuk.com> wrote:

> On 09/06/2024 12:12, Michael S wrote:
> > On Sun, 9 Jun 2024 11:20:11 +0100
> > bart <bc@freeuk.com> wrote:
> >   
> 
> >>> GCC on Windows or on Linux?
> >>> In my experience, gcc on Windows (ucrt64 variant, other gcc
> >>> variants are worse) very consistently produces bigger (stripped)
> >>> exe than even latest MSVCs which, as you correctly stated, are
> >>> not as good as older versions at producing small code.
> >>>
> >>> The size of 'Hello, world' program (x86-64, dynamically linked C
> >>> RTL) vs2013 - 6,144 bytes
> >>> vs2019 - 9,216 bytes
> >>> gcc (Debian Linux, -no-pie) - 14,400 bytes
> >>> gcc (Debian Linux) - 14,472 bytes
> >>> gcc (ucrt64 DLL) - 18,432 bytes
> >>> gcc (old DLL) - 42,496 bytes  
> >>
> >> I get a lot worse than that:
> >>  
> >>      C:\c>gcc hello.c  
> >>  
> >>      C:\c>dir a.exe  
> >>      09/06/2024  11:04           367,349 a.exe
> >>  
> >>      C:\c>gcc hello.c -s -Os  
> >>  
> >>      C:\c>dir a.exe  
> >>      09/06/2024  11:04            88,064 a.exe
> >>
> >> (It didn't like -Oz; did you mean something other than -Os?)
> >>  
> > 
> > No, I meant -Oz.
> > It was invented by clang, but newer gcc understand it.
> > I don't know what is a difference exactly, but -Oz tends to be a
> > little smaller.
> > In program as trivial as this, there should be no difference.
> >   
> >> Both import msvcrt.dll. gcc is version 10.3.0.
> >>  
> > 
> > My gcc variants are from msys2.
> > Where did you get yours?  
> 
> It's gcc/TDM. 

I never heard about TDM except from you.

> Anything else, I can spend 10 minutes following links
> to a mingw download, only to end up back where I started from.
> gcc/TDM is a much simpler installation.
>

Somehow, I installed msys2 many times, using 2 or 3 different methods
and it worked every single time. It's huge download, but it works.
There were cases where I had problems installing additional packages on
top of msys2, but they were always caused by idiotic policies of
corporate IT. At my personal systems it was always flawless.

This page appear to give correct up to date instructions
https://www.msys2.org/#installation


> >> tcc gives 2KB, and mcc gives 2.5KB.
> >>  
> > 
> > x86-64 or i386?  
> 
> All were for x64.
> 
> gcc's stdio.h header defines `printf` (which my hello.c uses) as an 
> inlined wrapper based around  `__mingw_vasprintf()`. So there might
> be further inlined stuff or that is statically linked, before it
> finally ends up calling the real `printf`.
> 

The size you mentioned in the previous post is suspiciously similar to
the size VS2013 statically linked binary.

> With gcc, I get 39.9KB for -m32 -Os -s.
> 

That is smaller than statically linked 32-bit VS2013 (73,216 bytes).
But a lot bigger than 6,144 DLL-based VS2013 32bit binary.

> If I use 'puts' instead, and -m32, then it gets down to 14KB.
> 
> 

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


Thread

Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-05-30 14:34 +0100
  Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-05-30 17:08 +0300
    Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-05-30 15:48 +0100
      Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-05-30 18:03 +0300
        Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-05-31 13:55 +0100
          Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-05-31 16:19 +0300
            Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-05-31 16:28 +0300
              Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-05-31 16:48 +0300
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-05-31 15:04 +0100
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-05-31 17:34 +0300
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-05-31 19:03 +0100
                Re: C23 thoughts and opinions scott@slp53.sl.home (Scott Lurndal) - 2024-05-31 18:36 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-05-31 22:15 +0100
                Re: C23 thoughts and opinions scott@slp53.sl.home (Scott Lurndal) - 2024-06-01 01:25 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-01 11:24 +0100
                Re: C23 thoughts and opinions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-06-01 05:17 -0700
                Re: C23 thoughts and opinions scott@slp53.sl.home (Scott Lurndal) - 2024-06-01 15:08 +0000
                Re: C23 thoughts and opinions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-06-01 17:22 -0700
                objcopy -I binary etc... Was: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-06 14:56 +0300
                Re: objcopy -I binary etc... Was: C23 thoughts and opinions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-06-06 07:44 -0700
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-01 22:51 +0300
                Re: C23 thoughts and opinions David Brown <david.brown@hesbynett.no> - 2024-06-01 15:24 +0200
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-01 19:59 +0100
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-04 04:00 +0000
                Re: Correct objcopy Usage (was Re: C23 thoughts and opinions) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-04 04:33 +0000
                Re: C23 thoughts and opinions jak <nospam@please.ty> - 2024-06-01 03:37 +0200
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-01 11:09 +0100
                Re: C23 thoughts and opinions jak <nospam@please.ty> - 2024-06-01 13:59 +0200
                Re: C23 thoughts and opinions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-06-01 17:26 -0700
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-02 01:11 +0300
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-02 00:39 +0100
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-02 03:06 +0300
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-06 14:43 +0300
                Re: C23 thoughts and opinions jak <nospam@please.ty> - 2024-05-31 21:42 +0200
                Re: C23 thoughts and opinions scott@slp53.sl.home (Scott Lurndal) - 2024-05-31 21:11 +0000
                Re: C23 thoughts and opinions BGB-Alt <bohannonindustriesllc@gmail.com> - 2024-06-06 15:38 -0500
                Re: C23 thoughts and opinions scott@slp53.sl.home (Scott Lurndal) - 2024-06-06 21:38 +0000
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-07 00:51 -0500
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-07 09:04 +0000
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-07 10:20 -0500
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-07 10:22 -0500
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-07 00:53 +0000
                Re: C23 thoughts and opinions BGB-Alt <bohannonindustriesllc@gmail.com> - 2024-06-07 16:58 -0500
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-08 03:08 +0000
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-08 00:04 -0500
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-08 08:27 +0000
                Re: C23 thoughts and opinions Bonita Montero <Bonita.Montero@gmail.com> - 2024-06-13 14:14 +0200
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-13 14:07 -0500
                Re: C23 thoughts and opinions Bonita Montero <Bonita.Montero@gmail.com> - 2024-06-14 08:53 +0200
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-14 03:13 -0500
                Re: C23 thoughts and opinions Bonita Montero <Bonita.Montero@gmail.com> - 2024-06-14 10:26 +0200
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-14 03:38 -0500
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-15 22:42 +0000
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-15 20:42 -0500
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-16 03:15 +0000
                Re: C23 thoughts and opinions scott@slp53.sl.home (Scott Lurndal) - 2024-06-08 13:09 +0000
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-09 00:46 +0000
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-09 11:19 +0300
                Re: C23 thoughts and opinions Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-08 19:28 +0100
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-08 14:52 -0500
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-09 12:40 +0300
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-09 11:20 +0100
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-09 14:12 +0300
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-09 14:44 +0300
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-09 17:32 +0100
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-09 20:00 +0300
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-09 21:06 +0100
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-09 23:40 +0300
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-09 22:49 +0100
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-10 01:06 +0300
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-10 01:26 +0100
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-11 08:33 +0000
                Re: C23 thoughts and opinions BGB <cr88192@gmail.com> - 2024-06-09 21:12 -0500
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-09 00:45 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-05-31 22:17 +0100
                Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-01 21:11 +0300
                Re: C23 thoughts and opinions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-06-01 17:47 -0700
            Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-05-31 15:03 +0100
          Re: C23 thoughts and opinions Kaz Kylheku <643-408-1753@kylheku.com> - 2024-05-31 15:34 +0000
          Re: C23 thoughts and opinions Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-05-31 20:31 +0100
          Re: C23 thoughts and opinions Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-01 01:53 +0100
            Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-01 11:53 +0100
              Re: C23 thoughts and opinions Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-01 16:51 +0100
      Re: C23 thoughts and opinions David Brown <david.brown@hesbynett.no> - 2024-05-31 09:24 +0200
        Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-05-31 13:39 +0300
          Re: C23 thoughts and opinions David Brown <david.brown@hesbynett.no> - 2024-05-31 13:31 +0200
    Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-05-30 17:51 +0300
  Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-01 01:39 +0000
    Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-01 11:37 +0100
      Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-02 03:27 +0000
        Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-02 10:37 +0100
          Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-03 01:16 +0000
            Re: C23 thoughts and opinions Michael S <already5chosen@yahoo.com> - 2024-06-03 11:16 +0300
              Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-04 02:10 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-04 12:28 +0100
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-05 01:51 +0000
                Re: C23 thoughts and opinions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-06-04 19:45 -0700
            Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-03 11:13 +0100
              Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-04 02:12 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-04 12:35 +0100
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-05 01:50 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-05 09:10 +0100
                Re: C23 thoughts and opinions Thiago Adams <thiago.adams@gmail.com> - 2024-06-05 09:23 -0300
                Re: C23 thoughts and opinions David Brown <david.brown@hesbynett.no> - 2024-06-05 15:09 +0200
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-06 02:12 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-06 19:38 +0100
                Re: C23 thoughts and opinions Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-07 00:55 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-07 22:23 +0100
                Re: C23 thoughts and opinions Kaz Kylheku <643-408-1753@kylheku.com> - 2024-06-08 00:39 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-08 02:14 +0100
                Re: C23 thoughts and opinions Kaz Kylheku <643-408-1753@kylheku.com> - 2024-06-08 03:55 +0000
                Re: C23 thoughts and opinions bart <bc@freeuk.com> - 2024-06-08 11:14 +0100
                Re: C23 thoughts and opinions "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-06-07 22:36 -0700

csiph-web