In cf459ca16f ("fprintf: Pretty print struct members that are pointers
to nameless structs") I added some recursive logic that theoretically
may end up doing an overlapping copy as reported by coverity:
Error: OVERLAPPING_COPY: [#def19]
dwarves-1.13/dwarves_fprintf.c:707: assign: Assigning: "name" = "namebfptr".
dwarves-1.13/dwarves_fprintf.c:705: equal: "name" is equal to the address of "namebfptr".
dwarves-1.13/dwarves_fprintf.c:705: overlapping_copy: In the call to function "snprintf", the arguments "name" and "namebfptr" may point to the same object.
# 703| if (tag__is_struct(ptype) || tag__is_union(ptype) ||
# 704| tag__is_enumeration(ptype)) {
# 705|-> snprintf(namebfptr, sizeof(namebfptr), "* %s", name);
# 706| tconf.rel_offset = 1;
# 707|
Look at cf459ca16f to see what this is about, but for now I'm just
checking if this is the case and adding a guard, at some point I'll
address this properly to allow for pointers to pointers to nameless
struct/union/enums.
Reported-by: William Cohen <wcohen@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Build instructions:
1. install cmake
2. mkdir build
3. cd build
4. cmake -D__LIB=lib ..
5. make install
Default is to be installed on /usr/local, see rpm spec file for
installing on other places.
Known to work scenarios:
Mandriva Cooker:
cmake 2.4.5-1mdv2007.1
libelfutils1-devel 0.123-1mdv2007.1
Debian Unstable:
cmake 2.4.5-1
libdw-dev 0.123-2
Fedora Core 6:
cmake 2.4.5-2.fc6
elfutils-devel 0.126-1.fc6