lvc / abi-compliance-checker

A tool for checking backward API/ABI compatibility of a C/C++ library
https://lvc.github.io/abi-compliance-checker/
GNU Lesser General Public License v2.1
621 stars 76 forks source link

Add statx to list of ignored functions #112

Closed kierdavis closed 3 years ago

kierdavis commented 3 years ago

statx (like stat, wait, flock, sysinfo) is both the name of a function:

/usr/include/bits/statx-generic.h:int statx (int __dirfd, const char *__restrict __path, int __flags,
/usr/include/bits/statx-generic.h:           unsigned int __mask, struct statx *__restrict __buf)

and a struct:

/usr/include/linux/stat.h:struct statx {
...
/usr/include/linux/stat.h:};

Typically statx always denotes the function and struct statx denotes the struct.

When usage of the struct is encountered in C++ code, abi-compliance-checker generates this line in dump1.h:

statx* tmp_add_class_66;

which fails to compile:

/tmp/qktDQcucCm/dump1.h:103:3: error: 'statx' does not name a type
   statx* tmp_add_class_66;
   ^~~~~

Ideally abi-compliance-checker should instead generate this in dump1.h:

struct statx* tmp_add_class_66;

but determining when the struct qualifier should/shouldn't be used seems non-trivial, so lets take the same approach as we do for other similarly overloaded names.

kierdavis commented 3 years ago

For the record, statx was introduced in Linux v4.11

lvc commented 3 years ago

Thanks!

Please note that abi-dumper is easier to use in most cases instead of compiling headers by abi-compliance-checker.