Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Suggested method for returning a string from a C program? Date: Thu, 20 Mar 2025 12:22:30 -0700 Organization: None to speak of Lines: 41 Message-ID: <87v7s3se15.fsf@nosuchdomain.example.com> References: <868qp1ra5f.fsf@linuxsc.com> <20250319115550.0000676f@yahoo.com> <20250319201903.00005452@yahoo.com> <86r02roqdq.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 20 Mar 2025 20:22:30 +0100 (CET) Injection-Info: dont-email.me; posting-host="2f20008cbcfa55ae60494be276e0bfaa"; logging-data="4043012"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XeMnuKiD7ONo4byeJ2y+m" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:MPZBNT8w2FmowXw5C4fVtx1m5r8= sha1:ufEE+zXjSlUHIzKPQFJGZZz8jBI= Bytes: 2677 bart writes: [...] > They're popular everywhere: > > typedef uint32_t Uint32; // from SDL2 > > typedef unsigned int GLuint; // from OpenGL > > typedef unsigned int l_uint32; // from Lua > > typedef unsigned int mz_uint32; // from MiniZ compression lib > > typedef uint32_t stbi__uint32; // from STB image library > > typedef uint8_t byte; // from arduino.h > > #ifndef UINT32_TYPE // from SQLite3 > # ifdef HAVE_UINT32_T > # define UINT32_TYPE uint32_t > # else > # define UINT32_TYPE unsigned int > # endif > #endif [...] > So I have to ask, why do think they do that? Almost certainly because they were originally implemented when was not universally available. It took a number of years after the publication of C99 before it was safe to assume that published code would never be compiled with a C90 compiler. In a new open source project starting today, it would make much more sense to use the types directly. But removing the project-specific typedefs now would break existing code that depends on them. [...] -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */