Path: csiph.com!weretis.net!feeder6.news.weretis.net!feeder7.news.weretis.net!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: OT: improve this simple algorithm? Date: Thu, 14 Nov 2019 10:10:38 -0800 Organization: None to speak of Lines: 27 Message-ID: References: <87a790zn7z.fsf@bsb.me.uk> <_85zF.5075$II7.2317@fx17.iad> <1TazF.334431$NI41.175762@fx12.am4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="91c2f33abe4e47ebddbfec820ab61ca8"; logging-data="32106"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wBwjLzrb3MtlXDYLJvBi7" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:7Kk2HyGzOFDOI5x10Bplir8yXMs= sha1:iknWHPVqgaa/TA/eOM085nwUuMY= Xref: csiph.com comp.lang.c:147988 Bart writes: [...] >> gcc -Wall -Wextra seq.c -o seq -Wno-sign-compare -O2 -fsanitize=undefined > > I get 'cannot find -lubsan', on Windows. [...] Apparently in some gcc configurations, the "-fsanitize=undefined" option causes to (attempt to) link a "libubsan" library. UBSan is an "undefined behaviour sanitizer". I have that library on my Ubuntu system, but I don't see it being linked when I invoke gcc with those options. I haven't reproduced the problem on Windows, but I'm sure my Windows environment is different from Bart's. A quick look at the gcc documentation reveals the '-fsanitize-undefined-trap-on-error' option, which causes it to use '__builtin_trap' rather than a libubsan library routine. That would be a way to avoid the dependency. Readers other than Bart might find this interesting. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */