[uclibc-ng-devel] [RFC PATCH] elf-{fdpic, dsbt}.h: avoid void pointer's subtraction

Waldemar Brodkorb wbx at uclibc-ng.org
Tue Sep 20 12:33:56 CEST 2016


Hi Rahul,
Rahul Bedarkar wrote,

> elf-fdpic.h or elf-dsbt.h is included by link.h. When C++ program
> includes <link.h>, we get following build failure.
> 
> ../usr/include/bits/elf-fdpic.h: In function 'void* __reloc_pointer(void*, const elf32_fdpic_loadmap*)':
> ../usr/include/bits/elf-fdpic.h:95: error: invalid use of 'void'
> 
> void pointer addition and subtraction is not allowed in C++ as it has
> undetermined size, however in C with language extension it is possible
> because sizeof void is treated as one byte.
> 
> Instead of performing subtraction on void pointers, typecast it to char*
> first.
> 
> This build failure is detected by Buildroot autobuilder.
> http://autobuild.buildroot.net/results/a10/a10ed48e6eb8411a3d8372f57c05fd11130da0e0/
> 
> Signed-off-by: Rahul Bedarkar <rahul.bedarkar at imgtec.com>

Great! Thanks, I had the issue on my TODO, nice that it is fixed
now.

pushed,
 Waldemar


More information about the devel mailing list