Article View: comp.os.linux.misc
Article #1990Re: Substantive Comments Please: GCC vs. LLMV
From: Chris Ahlstrom
Date: Tue, 03 Nov 2026 13:22
Date: Tue, 03 Nov 2026 13:22
31 lines
2611 bytes
2611 bytes
rbowman wrote this screed in ALL-CAPS (fixed):
> On Mon, 2 Nov 2026 14:18:27 -0500, Chris Ahlstrom wrote:
>
>> It found a few issues in a couple of my projects, a few issues
>> important.
>> There is one that I don't get
>>
>> subprojects/libcfg66/src/util/filefunctions.cpp:1138:33: warning:
>> Memory allocated by 'new[]' should be deallocated by 'delete[]',
>> not 'getline()' [unix.MismatchedDeallocator]
>>
>> 1138 | ssize_t count { getline(&destination, &maxim, input) };
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> I guess I need to use malloc() instead.
>
> Did you allocate destination with new? getline will malloc a buffer if you
> pass in NULL.
Yes, and I know that from the man page.
The point is scan-build complaining about something getline() will
not do in the given use case.
A limitation of static analysis, perhaps.
--
<Stealth> How do I bind a computer to an NIS server?
<Joey> Use a rope?
-- Seen on #Debian
Technical Details
Message-ID:
<11ccn72$3p6mj$2@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<18e37e973e22a7a6$1$3179723$802601b3@news.usenetexpress.com> <11c7kmg$22g7e$1@dont-email.me> <11c80ic$26et9$4@dont-email.me> <11cafc8$31pdt$1@dont-email.me> <11canpv$35aju$1@dont-email.me> <nks9f4F2rmsU5@mid.individual.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Chris Ahlstrom <OFeem1987@teleworm.us> Newsgroups: comp.os.linux.misc Subject: Re: Substantive Comments Please: GCC vs. LLMV Date: Tue, 3 Nov 2026 08:22:42 -0500 Organization: None Lines: 31 Message-ID: <11ccn72$3p6mj$2@dont-email.me> References: <18e37e973e22a7a6$1$3179723$802601b3@news.usenetexpress.com> <11c7kmg$22g7e$1@dont-email.me> <11c80ic$26et9$4@dont-email.me> <11cafc8$31pdt$1@dont-email.me> <11canpv$35aju$1@dont-email.me> <nks9f4F2rmsU5@mid.individual.net> Reply-To: OFeem1987@teleworm.us Injection-Date: Tue, 03 Nov 2026 13:22:43 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3971795"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182CEPGz/XFRiLFJhnhr4xg"; posting-host="8cb2a6ffe76257b494c6a403146fd1ea" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:/UPH3PjGT2ZMbOoizyH80JPORRE= sha256:oxtuoCYW1qO8qZqBYlTNsMbcO+dcZLsJKvl/OMDHYzw= sha1:MUw4JDCx+C8+KJqtYuAkvv9xFB4= sha256:qKb9KmY0sNQZACYOiPLwvzBkGjodk38NCdeTdG04ZBs= X-Slrn: Why use anything else? X-Mutt: The most widely-used MUA X-User-Agent: Microsoft Outl00k, Usenet K00k Editions X-Face: 63n<76,LYJQ2m#'5YL#.T95xqyPiG`ffIP70tN+j"(&@6(4l\7uL)2+/-r0)/9SjZ`qw= Njn mr93Xrerx}aQG-Ap5IHn"xe;`5:pp"$RH>Kx_ngWw%c\+6qSg!q"41n2[.N/;Pu6q8?+Poz~e A9? $6_R7cm.l!s8]yfv7x+-FYQ|/k