summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/common.c
diff options
context:
space:
mode:
authordumbbell <dumbbell@FreeBSD.org>2012-04-30 11:28:17 +0000
committerdumbbell <dumbbell@FreeBSD.org>2012-04-30 11:28:17 +0000
commit06fcd8e3650f3af601351d654aa343bf915496f2 (patch)
tree148ec2f8f1b6360bd4088be9bfaee7cad80331ac /lib/libfetch/common.c
parentb600972ec65464e2b002beea0ad6e80c5fd11ef1 (diff)
downloadFreeBSD-src-06fcd8e3650f3af601351d654aa343bf915496f2.zip
FreeBSD-src-06fcd8e3650f3af601351d654aa343bf915496f2.tar.gz
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@
Diffstat (limited to 'lib/libfetch/common.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud