1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-06 13:09:50 +00:00
freebsd/lib
Jean-Sébastien Pédron 671c033623 Remove incorrect __restrict qualifier on several pointers
The typical case was:
static __inline int
convert_ccl(FILE *fp, char * __restrict p, [...])
{
        [...]

        if (p == SUPPRESS_PTR) {
		[...]
	} else {
		[...]
	}

	[...]
}

This qualifier says that the pointer is the only one at that time
pointing to the resource.

Here, clang considers that "p" will never match "SUPPRESS_PTR" and
optimize the if{} block out. This leads to segfaults in programs calling
vfscanf(3) and vfwscanf(3) with just the format string (no arguments
following it).

The following softwares were reported to abort with segmentation fault
and this patch fixes it:
    o  cmake
    o  smartd
    o  devel/ORBit2

dim@ opened an LLVM PR to discuss this clang optimization:
    http://llvm.org/bugs/show_bug.cgi?id=12656

Tested by:	bsam@
2012-04-30 11:28:17 +00:00
..
bind Update to version 9.8.2, the latest from ISC, which contains numerous bug fixes. 2012-04-05 04:29:35 +00:00
clang Revert r234356 for now, as it leads to run-time problems on 32-bit 2012-04-23 06:33:27 +00:00
csu Revert r234356 for now, as it leads to run-time problems on 32-bit 2012-04-23 06:33:27 +00:00
libalias
libarchive Silence alignment warnings from clang in libarchive's ppmd code (which 2012-03-23 11:18:07 +00:00
libauditd
libbegemot
libblocksruntime
libbluetooth Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
libbsm
libbsnmp
libbz2
libc Remove incorrect __restrict qualifier on several pointers 2012-04-30 11:28:17 +00:00
libc++ Make sure libgcc_s is finished building in _startup_libs before 2012-03-17 22:12:09 +00:00
libcalendar
libcam Use snprintf(3) constantly when generating CAM error messages. 2012-03-03 09:19:20 +00:00
libcom_err - Update FreeBSD Heimdal distribution to version 1.5.1. This also brings 2012-03-22 08:48:42 +00:00
libcompat
libcompiler_rt
libcrypt Make the item numbers match the crypt magic number 2012-04-11 14:12:28 +00:00
libcxxrt Import new version of libcxxrt. Now works correctly with libobjc2 to implement 2012-03-20 17:58:15 +00:00
libdevinfo
libdevstat Globally replace u_int*_t from (non-contributed) man pages. 2012-02-12 18:29:56 +00:00
libdisk Remove an errant `#define dprintf printf'. It seems to be leftover 2012-01-20 06:59:29 +00:00
libdwarf
libedit Correct r228114 and use the same implementation for tilde.h as for history.h 2012-04-26 00:51:43 +00:00
libefi
libelf Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
libexpat
libfetch Support percent-encoded user and password 2012-04-11 15:42:02 +00:00
libgeom Back out r233646. Although it fixed most libgeom consumers under 32-bit 2012-04-10 17:37:24 +00:00
libgpib Remove superfluous paragraph macro. 2012-03-25 12:13:24 +00:00
libgssapi - Use __NO_TLS preprocessor value to make assumptions about TLS support 2012-04-08 03:55:25 +00:00
libiconv
libiconv_modules
libipsec MFp4 204292: 2012-02-11 20:43:01 +00:00
libipx
libjail Handle the case where a boolean parameter is also a node. 2012-03-01 15:09:41 +00:00
libkiconv
libkse Fix typo in ".PATH" 2012-04-18 07:02:53 +00:00
libkvm Try to avoid ambiguity when sysctl returns ENOMEM additionally 2012-02-01 18:02:13 +00:00
liblzma
libmagic Update file(1) to version 5.11. 2012-04-19 03:20:13 +00:00
libmd Remove the RFC 1319 MD2 Message-Digest Algorithm routines from libmd. 2012-04-28 02:48:51 +00:00
libmemstat Fix various typos in manual pages. 2012-02-25 14:31:25 +00:00
libmilter
libmp
libncp
libnetgraph
libngatm
libopie X11BASE has been deprecated for a long time and will die soon 2012-01-09 00:48:19 +00:00
libpam Fix error messages containing the executed command name 2012-04-12 14:02:59 +00:00
libpcap
libpmc mdoc: sort prologue macros. 2012-03-29 06:19:00 +00:00
libproc Make libproc compilable for MIPS 2012-03-23 23:07:02 +00:00
libprocstat Export some more useful info about shared memory objects to userland 2012-04-01 18:22:48 +00:00
libradius Globally replace u_int*_t from (non-contributed) man pages. 2012-02-12 18:29:56 +00:00
librpcsec_gss Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
librpcsvc Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor 2012-02-07 09:27:07 +00:00
librt Register signal 33 explicitly as reserved by real-time library, and 2012-03-26 19:12:09 +00:00
librtld_db
libsbuf
libsdp
libsm Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to 2012-02-28 18:30:18 +00:00
libsmb
libsmdb
libsmutil
libstand
libstdbuf Fix small documentation mistakes. 2012-04-28 21:50:30 +00:00
libstdthreads
libtacplus Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
libtelnet - Do not use deprecated krb5 error message reporting functions in libtelnet. 2012-04-06 00:03:45 +00:00
libthr Set SIGCANCEL to SIGTHR as part of some cleanup of DTrace code. 2012-04-18 16:29:55 +00:00
libthread_db Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to 2012-02-28 18:30:18 +00:00
libufs
libugidfw
libulog Properly use SHA1_Final() instead of SHA_Final(). 2012-04-19 15:28:15 +00:00
libusb Fix typo. 2012-04-25 21:59:56 +00:00
libusbhid
libutil mdoc: terminate quoted strings. 2012-03-30 12:34:34 +00:00
libvgl Fix various typos in manual pages. 2012-02-25 14:31:25 +00:00
libwrap
liby
libypclnt Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor 2012-02-07 09:27:07 +00:00
libz Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to 2012-02-28 18:30:18 +00:00
msun I stopped using my middle name years ago. 2012-04-25 18:07:35 +00:00
ncurses
Makefile Import stdbuf(1) and the shared library it relies on. 2012-04-28 20:52:20 +00:00
Makefile.inc