Re: Suggested method for returning a string from a C program?

Liste des GroupesRevenir à cl c  
Sujet : Re: Suggested method for returning a string from a C program?
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.c
Date : 23. Mar 2025, 02:34:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrnoft$15f6n$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
User-Agent : Mozilla Thunderbird
On 22/03/2025 21:52, Keith Thompson wrote:
bart <bc@freeuk.com> writes:
On 22/03/2025 03:50, Keith Thompson wrote:
bart <bc@freeuk.com> writes:
On 21/03/2025 19:04, Keith Thompson wrote:
bart <bc@freeuk.com> writes:
[...]
I think your response clarifies matters. Nobody cares, even as
compilers grind to a halt under all preprocessing.
If compilers ground to a halt, I would certainly care.  They don't.
>
50 modules each including GTK.h say, which was 0.33Mloc across 500
headers (so reading 16Mloc and 25,000 headers in total when all are
compiled) would not impact your builds at all? OK.
First you talked about compilers grinding to a halt, then you talked
about headers not impacting builds at all.  Those goalposts of yours
move *fast*.
>
You missed the "?".
 No, I didn't.  You insinuated that I had implied that large headers
would not impact builds.  You phrased it as if you were questioning
something I had said.  I don't care to debate this specific issue
further, but please be mmore careful.
 
For the record, as you can see above, I did not say that builds would
not be impacted.  Do not put words into my mouth again.
>
Let me ask it again: so ploughing through a third of a million lines
of code across hundreds of #includes, even at the faster throughput
compared with compiling code, for a module of a few hundred lines,
will have little impact?
>
How about a project with 50 or 100 modules, each using that big
header, that needs to be built from scratch?
 I don't know.  I haven't taken the time to measure the impact,
and if I did there wouldn't be much I could do about it.  It hasn't
particularly inconvenienced me.
 Most of the builds I do from source are straightforward.  The general
pattern is roughly "configure;make;sudo make install".  I have
a wrapper script that does that, figures out what arguments to
pass, adds some extra options, and so forth.  I'm aware configures
scripts can be very large (the one for coreutils close to 95,000
lines), but I really don't care or see why I should.  It works.
Building coreutils and installing 9.6 on my system took about 5
minutes, during which I was able to go off and do other things.
It's strange: in one part of the computing world, the speed of building software is a very big deal. All sorts of efforts are going on to deal with it. Compilation speed for developers is always an issue. There is a general movement away from LLVM-based backends /because/ it is so slow.
And yet in another part (namely comp.lang.c) it appears to be a total non-issue!
Maybe people are just so inured to lengthy build-times that they think it is quite normal. Or the slowness is hidden behind clever makefiles that do their utmost to avoid compiling as much as possible. Or they just throw extra resources (fast machines and lots of cores) to mitigate it.

Could the whole thing be streamlined?  Could a new version of the
autotools be developed that doesn't cater as much to obsolete systems
and generates smaller configure scripts?  Would it substantially
improve build times?  Quite possibly, but I'm not likely to be the
one to work about the details (unless someone wants to hire me to
look into it).
Build-times is one part; ease of deployment is another. This is the the API for SDL2 as translated from C headers into my language:
   C:\sdl>dir sdl.m
   8/07/2024  13:15           158,055 sdl.m
Below is the API in its original C form. The above file is much easier to work with, copy, bundle, browse etc. I ask you, why would anybody care about all those separate headers? What purpose they do serve?
(This SDL library is small compared with some! At least all the files are in one folder.)

[...]
 
So let me ask /this/ again: if such a library consisted of ONE compact
header file, would it make the process simpler? Would it make
compilation of multiple modules faster?)
 I don't know.
But it seems likely that it would. It's hardly going to make it slower!
When I have time, I will look into it myself. There is already a feature of my C compiler that can reduce a complex set of headers into one file [demonstrated above], but in the syntax of one of my two languages.
That could be modified to generate C instead. (This is not just preprocessing; it needs to build a symbol table then work from that, taking care to preserve macro definitions, and suppressing system header symbols.)
------------------
   c:\sdl\dir sdl2
   14/06/2023  19:02             5,512 begin_code.h
   14/06/2023  19:02             1,480 close_code.h
   14/06/2023  19:02             8,084 SDL.h
   14/06/2023  19:02            12,455 SDL_assert.h
   14/06/2023  19:02            14,796 SDL_atomic.h
   14/06/2023  19:02            59,694 SDL_audio.h
   14/06/2023  19:02             3,205 SDL_bits.h
   14/06/2023  19:02             9,047 SDL_blendmode.h
   14/06/2023  19:02             4,307 SDL_clipboard.h
   14/06/2023  19:02             8,894 SDL_config.h
   14/06/2023  19:02            17,458 SDL_cpuinfo.h
   14/06/2023  19:02           108,871 SDL_egl.h
   14/06/2023  19:02             9,802 SDL_endian.h
   14/06/2023  19:02             5,177 SDL_error.h
   14/06/2023  19:02            47,284 SDL_events.h
   14/06/2023  19:02             5,533 SDL_filesystem.h
   14/06/2023  19:02            40,039 SDL_gamecontroller.h
   14/06/2023  19:02             3,418 SDL_gesture.h
   14/06/2023  19:02             3,146 SDL_guid.h
   14/06/2023  19:02            43,268 SDL_haptic.h
   14/06/2023  19:02            17,842 SDL_hidapi.h
   14/06/2023  19:02           110,398 SDL_hints.h
   14/06/2023  19:02            39,015 SDL_joystick.h
   14/06/2023  19:02            11,044 SDL_keyboard.h
   14/06/2023  19:02            15,629 SDL_keycode.h
   14/06/2023  19:02             3,908 SDL_loadso.h
   14/06/2023  19:02             3,812 SDL_locale.h
   14/06/2023  19:02            11,684 SDL_log.h
   14/06/2023  19:02             8,809 SDL_main.h
   14/06/2023  19:02             6,693 SDL_messagebox.h
   14/06/2023  19:02             3,380 SDL_metal.h
   14/06/2023  19:02             2,845 SDL_misc.h
   14/06/2023  19:02            17,087 SDL_mouse.h
   14/06/2023  19:02            14,286 SDL_mutex.h
   14/06/2023  19:02             1,155 SDL_name.h
   14/06/2023  19:02            81,091 SDL_opengl.h
   14/06/2023  19:02             1,254 SDL_opengles.h
   14/06/2023  19:02             1,606 SDL_opengles2.h
   14/06/2023  19:02            42,938 SDL_opengles2_gl2.h
   14/06/2023  19:02           241,221 SDL_opengles2_gl2ext.h
   14/06/2023  19:02               646 SDL_opengles2_gl2platform.h
   14/06/2023  19:02            11,131 SDL_opengles2_khrplatform.h
   14/06/2023  19:02           863,870 SDL_opengl_glext.h
   14/06/2023  19:02            24,522 SDL_pixels.h
   28/07/2024  12:43             6,746 SDL_platform.h
   14/06/2023  19:02             3,199 SDL_power.h
   14/06/2023  19:02             2,106 SDL_quit.h
   14/06/2023  19:02            12,860 SDL_rect.h
   14/06/2023  19:02            73,762 SDL_render.h
   14/06/2023  19:02               243 SDL_revision.h
   14/06/2023  19:02            28,101 SDL_rwops.h
   14/06/2023  19:02            16,929 SDL_scancode.h
   14/06/2023  19:02            10,265 SDL_sensor.h
   14/06/2023  19:02             5,904 SDL_shape.h
   14/06/2023  19:02            29,523 SDL_stdinc.h
   14/06/2023  19:02            36,798 SDL_surface.h
   14/06/2023  19:02            20,772 SDL_system.h
   14/06/2023  19:02            11,506 SDL_syswm.h
   14/06/2023  19:02             2,000 SDL_test.h
   14/06/2023  19:02             3,235 SDL_test_assert.h
   14/06/2023  19:02             6,872 SDL_test_common.h
   14/06/2023  19:02             2,163 SDL_test_compare.h
   14/06/2023  19:02             3,385 SDL_test_crc32.h
   14/06/2023  19:02             5,432 SDL_test_font.h
   14/06/2023  19:02            13,203 SDL_test_fuzzer.h
   14/06/2023  19:02             4,634 SDL_test_harness.h
   14/06/2023  19:02             2,215 SDL_test_images.h
   14/06/2023  19:02             1,954 SDL_test_log.h
   14/06/2023  19:02             4,630 SDL_test_md5.h
   14/06/2023  19:02             1,787 SDL_test_memory.h
   14/06/2023  19:02             3,156 SDL_test_random.h
   14/06/2023  19:02            17,273 SDL_thread.h
   14/06/2023  19:02             7,290 SDL_timer.h
   14/06/2023  19:02             4,506 SDL_touch.h
   14/06/2023  19:02             1,031 SDL_types.h
   14/06/2023  19:02             6,870 SDL_version.h
   14/06/2023  19:02            79,917 SDL_video.h
   14/06/2023  19:02             8,540 SDL_vulkan.h
                 78 File(s)      4,774,738 bytes

Date Sujet#  Auteur
19 Mar 25 * Suggested method for returning a string from a C program?391DFS
19 Mar 25 +* Re: Suggested method for returning a string from a C program?4Keith Thompson
19 Mar 25 i+- Re: Suggested method for returning a string from a C program?1Keith Thompson
19 Mar 25 i`* Re: Suggested method for returning a string from a C program?2DFS
19 Mar 25 i `- Re: Suggested method for returning a string from a C program?1Keith Thompson
19 Mar 25 +* Re: Suggested method for returning a string from a C program?323Tim Rentsch
19 Mar 25 i+* Re: Suggested method for returning a string from a C program?2DFS
19 Mar 25 ii`- Re: Suggested method for returning a string from a C program?1Richard Heathfield
19 Mar 25 i`* Re: Suggested method for returning a string from a C program?320DFS
19 Mar 25 i +* Re: Suggested method for returning a string from a C program?6Tim Rentsch
19 Mar 25 i i`* Re: Suggested method for returning a string from a C program?5DFS
19 Mar 25 i i +* Re: Suggested method for returning a string from a C program?3James Kuyper
19 Mar 25 i i i+- Re: Suggested method for returning a string from a C program?1Keith Thompson
19 Mar 25 i i i`- Re: Suggested method for returning a string from a C program?1DFS
19 Mar 25 i i `- Re: Suggested method for returning a string from a C program?1Tim Rentsch
19 Mar 25 i `* Re: Suggested method for returning a string from a C program?313Michael S
19 Mar 25 i  +* Re: Suggested method for returning a string from a C program?309DFS
19 Mar 25 i  i`* Re: Suggested method for returning a string from a C program?308Richard Heathfield
19 Mar 25 i  i `* Re: Suggested method for returning a string from a C program?307Michael S
19 Mar 25 i  i  +- Re: Suggested method for returning a string from a C program?1Richard Heathfield
20 Mar 25 i  i  `* Re: Suggested method for returning a string from a C program?305Tim Rentsch
20 Mar 25 i  i   `* Re: Suggested method for returning a string from a C program?304bart
20 Mar 25 i  i    +* Re: Suggested method for returning a string from a C program?298bart
20 Mar 25 i  i    i+* Re: Suggested method for returning a string from a C program?92Muttley
20 Mar 25 i  i    ii+* Re: Suggested method for returning a string from a C program?8Michael S
20 Mar 25 i  i    iii`* Re: Suggested method for returning a string from a C program?7Muttley
20 Mar 25 i  i    iii `* Re: Suggested method for returning a string from a C program?6Michael S
20 Mar 25 i  i    iii  +* Re: Suggested method for returning a string from a C program?3Muttley
23 Mar 25 i  i    iii  i`* Re: Suggested method for returning a string from a C program?2Michael S
23 Mar 25 i  i    iii  i `- Re: Suggested method for returning a string from a C program?1Tim Rentsch
20 Mar 25 i  i    iii  +- Re: Suggested method for returning a string from a C program?1Tim Rentsch
20 Mar 25 i  i    iii  `- Re: Suggested method for returning a string from a C program?1Keith Thompson
20 Mar 25 i  i    ii`* Re: Suggested method for returning a string from a C program?83bart
20 Mar 25 i  i    ii +- Re: Suggested method for returning a string from a C program?1Muttley
20 Mar 25 i  i    ii +* Re: Suggested method for returning a string from a C program?80Michael S
20 Mar 25 i  i    ii i`* Re: Suggested method for returning a string from a C program?79bart
20 Mar 25 i  i    ii i +* Re: Suggested method for returning a string from a C program?3Kaz Kylheku
20 Mar 25 i  i    ii i i`* Re: Suggested method for returning a string from a C program?2Michael S
20 Mar 25 i  i    ii i i `- Re: Suggested method for returning a string from a C program?1Kaz Kylheku
21 Mar 25 i  i    ii i `* Re: Suggested method for returning a string from a C program?75Keith Thompson
24 Mar 25 i  i    ii i  `* The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)74Janis Papanagnou
24 Mar 25 i  i    ii i   `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)73Keith Thompson
25 Mar 25 i  i    ii i    `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)72David Brown
25 Mar 25 i  i    ii i     +* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)5Kaz Kylheku
25 Mar 25 i  i    ii i     i`* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)4David Brown
25 Mar 25 i  i    ii i     i `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)3Keith Thompson
26 Mar 25 i  i    ii i     i  +- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Chris M. Thomasson
26 Mar 25 i  i    ii i     i  `- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1David Brown
25 Mar 25 i  i    ii i     +* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)64Janis Papanagnou
25 Mar 25 i  i    ii i     i+* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)54bart
25 Mar 25 i  i    ii i     ii`* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)53Janis Papanagnou
26 Mar 25 i  i    ii i     ii +* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)2bart
26 Mar 25 i  i    ii i     ii i`- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Janis Papanagnou
26 Mar 25 i  i    ii i     ii `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)50David Brown
26 Mar 25 i  i    ii i     ii  `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)49Janis Papanagnou
26 Mar 25 i  i    ii i     ii   `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)48David Brown
26 Mar 25 i  i    ii i     ii    `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)47Janis Papanagnou
26 Mar 25 i  i    ii i     ii     +- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1David Brown
27 Mar 25 i  i    ii i     ii     `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)45bart
27 Mar 25 i  i    ii i     ii      +- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1bart
27 Mar 25 i  i    ii i     ii      +* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)4Waldek Hebisch
27 Mar 25 i  i    ii i     ii      i`* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)3bart
27 Mar 25 i  i    ii i     ii      i +- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1David Brown
28 Mar 25 i  i    ii i     ii      i `- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Waldek Hebisch
27 Mar 25 i  i    ii i     ii      `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)39Janis Papanagnou
27 Mar 25 i  i    ii i     ii       +* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)13bart
28 Mar 25 i  i    ii i     ii       i`* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)12Janis Papanagnou
28 Mar 25 i  i    ii i     ii       i +* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)9David Brown
28 Mar 25 i  i    ii i     ii       i i+* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)7Janis Papanagnou
28 Mar 25 i  i    ii i     ii       i ii+* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)2Michael S
28 Mar 25 i  i    ii i     ii       i iii`- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Janis Papanagnou
28 Mar 25 i  i    ii i     ii       i ii+* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)2bart
28 Mar 25 i  i    ii i     ii       i iii`- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Janis Papanagnou
28 Mar 25 i  i    ii i     ii       i ii`* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)2David Brown
28 Mar 25 i  i    ii i     ii       i ii `- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Janis Papanagnou
28 Mar 25 i  i    ii i     ii       i i`- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Chris M. Thomasson
28 Mar 25 i  i    ii i     ii       i +- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1bart
31 Mar 25 i  i    ii i     ii       i `- [OT] PC hardware prices [correction] (was Re: The integral type 'byte')1Janis Papanagnou
27 Mar 25 i  i    ii i     ii       `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)25David Brown
28 Mar 25 i  i    ii i     ii        `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)24Janis Papanagnou
28 Mar 25 i  i    ii i     ii         +* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)18Chris M. Thomasson
28 Mar 25 i  i    ii i     ii         i`* [OT] SPARC (was Re: The integral type 'byte')17Janis Papanagnou
28 Mar 25 i  i    ii i     ii         i +- Re: [OT] SPARC (was Re: The integral type 'byte')1Keith Thompson
28 Mar 25 i  i    ii i     ii         i +* Re: [OT] SPARC (was Re: The integral type 'byte')14Michael S
28 Mar 25 i  i    ii i     ii         i i+* Re: [OT] SPARC (was Re: The integral type 'byte')8David Brown
28 Mar 25 i  i    ii i     ii         i ii+* Re: [OT] SPARC (was Re: The integral type 'byte')6Michael S
28 Mar 25 i  i    ii i     ii         i iii`* Re: [OT] SPARC (was Re: The integral type 'byte')5David Brown
28 Mar 25 i  i    ii i     ii         i iii +* Re: [OT] SPARC (was Re: The integral type 'byte')3Chris M. Thomasson
28 Mar 25 i  i    ii i     ii         i iii i+- Re: [OT] SPARC (was Re: The integral type 'byte')1Chris M. Thomasson
28 Mar 25 i  i    ii i     ii         i iii i`- Re: [OT] SPARC (was Re: The integral type 'byte')1Kaz Kylheku
28 Mar 25 i  i    ii i     ii         i iii `- Re: [OT] SPARC (was Re: The integral type 'byte')1Kaz Kylheku
28 Mar 25 i  i    ii i     ii         i ii`- Re: [OT] SPARC (was Re: The integral type 'byte')1Kaz Kylheku
28 Mar 25 i  i    ii i     ii         i i`* Re: [OT] SPARC (was Re: The integral type 'byte')5Janis Papanagnou
28 Mar 25 i  i    ii i     ii         i i `* Re: [OT] SPARC (was Re: The integral type 'byte')4Michael S
28 Mar 25 i  i    ii i     ii         i i  +* Re: [OT] SPARC (was Re: The integral type 'byte')2Janis Papanagnou
28 Mar 25 i  i    ii i     ii         i i  i`- Re: [OT] SPARC (was Re: The integral type 'byte')1David Brown
28 Mar 25 i  i    ii i     ii         i i  `- Re: [OT] SPARC (was Re: The integral type 'byte')1Kaz Kylheku
28 Mar 25 i  i    ii i     ii         i `- Re: [OT] SPARC (was Re: The integral type 'byte')1Chris M. Thomasson
28 Mar 25 i  i    ii i     ii         `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)5David Brown
28 Mar 25 i  i    ii i     ii          +- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Michael S
28 Mar 25 i  i    ii i     ii          +* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)2bart
28 Mar 25 i  i    ii i     ii          `- Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)1Janis Papanagnou
26 Mar 25 i  i    ii i     i`* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)9David Brown
25 Mar 25 i  i    ii i     `* Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?)2Keith Thompson
20 Mar 25 i  i    ii `- Re: Suggested method for returning a string from a C program?1Keith Thompson
20 Mar 25 i  i    i+* Re: Suggested method for returning a string from a C program?93bart
20 Mar 25 i  i    i+* Re: Suggested method for returning a string from a C program?90Keith Thompson
21 Mar 25 i  i    i`* Re: Suggested method for returning a string from a C program?22Waldek Hebisch
20 Mar 25 i  i    +- Re: Suggested method for returning a string from a C program?1Michael S
20 Mar 25 i  i    +- Re: Suggested method for returning a string from a C program?1Muttley
20 Mar 25 i  i    +- Re: Suggested method for returning a string from a C program?1Kaz Kylheku
20 Mar 25 i  i    +- Re: Suggested method for returning a string from a C program?1Tim Rentsch
20 Mar 25 i  i    `- Re: Suggested method for returning a string from a C program?1Keith Thompson
19 Mar 25 i  `* Re: Suggested method for returning a string from a C program?3Tim Rentsch
19 Mar 25 +* Re: Suggested method for returning a string from a C program?27Keith Thompson
19 Mar 25 +* Re: Suggested method for returning a string from a C program?9Ike Naar
19 Mar 25 +* Re: Suggested method for returning a string from a C program?19bart
19 Mar 25 +* Re: Suggested method for returning a string from a C program?6Michael S
22 Mar 25 `* Re: Suggested method for returning a string from a C program?2Lynn McGuire

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal