* [PATCH, applied] ir: Recognize "void* as being equal to all other pointers in C
@ 2023-04-14 13:40 Dodji Seketeli
0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2023-04-14 13:40 UTC (permalink / raw)
To: libabigail
[-- Attachment #1: Type: text/plain, Size: 6831 bytes --]
Hello,
Today, the pointer-to-void type is naively considered as being
different to all other pointers by Libabigail. This indirectly leads
to spurious changes in code bases where we have this kind of pattern:
/* in foo.h */
typedef void* some_pointer_type;
struct foo
{
some_pointer_type member;
};
bool
test_some_pointer_type(some_pointer_type);
/* This header file is included by client code */
/*in foo.c */
typedef int* some_pointer_type;
struct foo
{
some_pointer_type member;
};
bool
test_some_pointer_type(some_pointer_type f)
{
/* The actual implementation. */
}
Another way to reproduce that spurious change is to run this command:
$ fedabipkgdiff --self-compare -a --from fc37 glibc
* include/abg-fwd.h (is_void_pointer_type): Declare new function.
* src/abg-ir.cc (is_void_pointer_type): Define new function.
(equals): In the overload for pointer_type_def, handle the special
case pointer to void, making it equal to all other pointer, for
the C language.
(is_non_canonicalized_type): pointer to void is no more
canonicalized as it can be equal to all other types.
* tests/data/test-annotate/libtest23.so.abi: Adjust
* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise.
* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise.
* tests/data/test-annotate/test1.abi: Likewise.
* tests/data/test-annotate/test13-pr18894.so.abi: Likewise.
* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
Likewise.
* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
Likewise.
* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
Likewise.
* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
* tests/data/test-annotate/test5.o.abi: Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-filter/test47-filter-void-ptr-change-report-0.txt:
Likewise.
* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi:
Likewise.
* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
* tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise.
* tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi:
Likewise.
* tests/data/test-read-dwarf/libtest23.so.abi: Likewise.
* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise.
* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise.
* tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise.
* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
* tests/data/test-read-dwarf/test1.abi: Likewise.
* tests/data/test-read-dwarf/test1.hash.abi: Likewise.
* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
* tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise.
* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise.
* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
Likewise.
* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.
* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
Likewise.
* tests/data/test-read-dwarf/test5.o.abi: Likewise.
* tests/data/test-read-dwarf/test5.o.hash.abi: Likewise.
* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
include/abg-fwd.h | 3 +
src/abg-ir.cc | 23 +
tests/data/test-annotate/libtest23.so.abi | 159 +-
.../test-annotate/libtest24-drop-fns-2.so.abi | 140 +-
.../test-annotate/libtest24-drop-fns.so.abi | 140 +-
tests/data/test-annotate/test1.abi | 3 +-
.../data/test-annotate/test13-pr18894.so.abi | 2025 +-
.../data/test-annotate/test14-pr18893.so.abi | 6683 +--
.../data/test-annotate/test15-pr18892.so.abi | 26650 +++++-----
.../data/test-annotate/test17-pr19027.so.abi | 15431 +++---
...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 7613 +--
...19-pr19023-libtcmalloc_and_profiler.so.abi | 15332 +++---
...st20-pr19025-libvtkParallelCore-6.1.so.abi | 13743 ++---
.../data/test-annotate/test21-pr19092.so.abi | 6203 +--
tests/data/test-annotate/test5.o.abi | 3 +-
.../test31-pr18535-libstdc++-report-1.txt | 2 +-
...test47-filter-void-ptr-change-report-0.txt | 3 -
.../PR22015-libboost_iostreams.so.abi | 752 +-
.../test-read-dwarf/PR22122-libftdc.so.abi | 7420 +--
.../data/test-read-dwarf/PR25007-sdhci.ko.abi | 4447 +-
.../PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi | 247 +-
tests/data/test-read-dwarf/libtest23.so.abi | 158 +-
.../libtest24-drop-fns-2.so.abi | 139 +-
.../test-read-dwarf/libtest24-drop-fns.so.abi | 139 +-
.../test-read-dwarf/test-libaaudio.so.abi | 21 +-
.../test-read-dwarf/test-libandroid.so.abi | 801 +-
tests/data/test-read-dwarf/test1.abi | 2 +-
tests/data/test-read-dwarf/test1.hash.abi | 2 +-
.../test-read-dwarf/test10-pr18818-gcc.so.abi | 2831 +-
.../test-read-dwarf/test11-pr18828.so.abi | 947 +-
.../test-read-dwarf/test12-pr18844.so.abi | 23466 ++++-----
.../test-read-dwarf/test13-pr18894.so.abi | 2014 +-
.../test-read-dwarf/test14-pr18893.so.abi | 6674 +--
.../test-read-dwarf/test15-pr18892.so.abi | 26626 +++++-----
.../test-read-dwarf/test16-pr18904.so.abi | 16814 +++---
.../test-read-dwarf/test17-pr19027.so.abi | 15214 +++---
...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 7569 +--
...19-pr19023-libtcmalloc_and_profiler.so.abi | 15276 +++---
...st20-pr19025-libvtkParallelCore-6.1.so.abi | 13353 ++---
.../test-read-dwarf/test21-pr19092.so.abi | 6169 +--
.../test22-pr19097-libstdc++.so.6.0.17.so.abi | 43306 ++++++++--------
tests/data/test-read-dwarf/test5.o.abi | 2 +-
tests/data/test-read-dwarf/test5.o.hash.abi | 2 +-
.../test9-pr18818-clang.so.abi | 3122 +-
44 files changed, 146301 insertions(+), 145368 deletions(-)
The patch is too big for the mailing list so I am attaching a gzipped
version of it.
[-- Attachment #2: 0003-ir-Recognize-void-as-being-equal-to-all-other-pointe.patch.gz --]
[-- Type: application/gzip, Size: 2714845 bytes --]
[-- Attachment #3: Type: text/plain, Size: 28 bytes --]
Cheers,
--
Dodji.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-14 13:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14 13:40 [PATCH, applied] ir: Recognize "void* as being equal to all other pointers in C Dodji Seketeli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).