Article View: comp.lang.c
Article #1978Re: is wraper on realloc good idea? maybe more wrappers?
From: fir
Date: Sun, 29 Nov 2026 19:45
Date: Sun, 29 Nov 2026 19:45
42 lines
3365 bytes
3365 bytes
fir pisze: > Ross Finlayson pisze: >> On 11/29/2026 08:48 AM, fir wrote: >>> Andrey Tarasevich pisze: >>>> On Sun 11/29/2026 4:16 AM, fir wrote: >>>>> never used it but generally wrappers on some standard functions >>>>> probably are good idea, or not? >>>> >>>> In programs that perform non-interactive batch-style processing (e.g. >>>> config file on input, result file on output), error handling is >>>> usually a very simple affair: just complain and abort, no need for any >>>> kind of post-error recovery in most cases. In such programs wrappers >>>> around malloc/calloc/realloc work very well. The wrapper checks for >>>> success and simply aborts the entire program with an error message in >>>> case of failure. This allows client code to completely forget about >>>> having to worry about this sort of errors. I.e. it uses the wrapper >>>> under assumption that the wrapper "always succeeds". >>>> >>> >>> but there is normal ERROR (the one that calls ERROR() function , more >>> specifically ERROR_() in my case as ERROR is by some sht reserved by >>> winapi i guess) and there are CRASHes..crashes you need to localize, >>> in winapi i may register signel handler so it calls my function that for >>> example shows messagoe box .. >> >> Does it build just fine on Navia's LCC or Mingw64? >> > i use mingw32 and some older version as when i last checked (quite few > years ago) the more new was slower..(and i prefer faster) > more specifically i use tdm 5 and 10 (preferably 5) i downloaded gcc 16 but it throws 150 fake errors in my face (where i dont add void as i dont like etc) this is so called populists takeover when they make freedom and error (note my approach to programing is ratcher oposite, freedom is encouraged..as oldc also was - until populist jumped on t with their asses) (more worse i dont see a switch to disable it and i no plan to sid and do thsi idiotic work adding that voids etc)
Technical Details
Message-ID:
<11ehvd1$3q3lq$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ehl0l$3lnis$1@dont-email.me> <TPadnZE62NL0x5H2nZ2dnZfqn_aOsyBo@giganews.com> <11ehn8f$3ml53$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: fir <profesor.fir@gmail.com> Newsgroups: comp.lang.c Subject: Re: is wraper on realloc good idea? maybe more wrappers? Date: Sun, 29 Nov 2026 20:45:37 +0100 Organization: A noiseless patient Spider Lines: 42 Message-ID: <11ehvd1$3q3lq$1@dont-email.me> References: <11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ehl0l$3lnis$1@dont-email.me> <TPadnZE62NL0x5H2nZ2dnZfqn_aOsyBo@giganews.com> <11ehn8f$3ml53$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 29 Nov 2026 19:45:37 +0000 (UTC) Injection-Info: dont-email.me; logging-data="4001466"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19u+ZPqleQx5zbRdYk9CdfjWqsbtqFJhiM="; posting-host="010f8b8bacc4ceb5b8d9de2edad353cd" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:zchQ3ajh8IUnZ6+2nXHCEIUUaLI= sha256:YXE29s9nlcsIJuM2WEmcSWVIVHffoNOK212aj8WGst0= sha1:eK3fG57Qr3BuKnq77g7rhxcGHA8= sha256:DZDDtwPTw3t1Mx+QmxIn810CF2nFG6EcZzwCtwp0o8c= In-Reply-To: <11ehn8f$3ml53$1@dont-email.me>