Hello Mark, Mark Wielaard a écrit: > Hi Dodji, > > On Mon, 2020-04-06 at 19:15 +0200, Dodji Seketeli wrote: >> > Note how abidiff treats the function return type and parameters changed >> > from void * to Foo * as disappearing. >> > >> > Is there another way to achieve what I want/need? >> >> I think there is a non-documented way to do this, yes. It hasn't been >> yet documented because nobody expressed the need for it yet. >> >> Basically you want to do this: >> >> [suppress_type] >> label = "Artificial·private·types·suppression·specification" > > Assuming those fancy dots are actually spaces. Pfff, sorry, my copy-paste-fu failed miserably there. I am attaching below the libfoo.supp suppression file I used. Actually, there are no '"' delimitation character either. [...] > It doesn't seem to change anything for my example. I assume it does > for you? Yes, sorry, it's my fault. I hope with suppression file below it gets better. > Can you attach the xml abi file it is supposed to generate? Mine still > looks like the attached with missing return types and arguments where > there should be pointers to Foo. Maybe my suppression file still isn't > correct? I attached both. I attached the resulting abixml file I am getting below as well. >> > Or can we have a "drop mode" that treats handles to dropped types a >> > simple void pointers instead? >> >> I think what you'd need, really, is a combination of: >> >> 1/ a new --header-files{1,2} option >> 2/ an "opaque = yes" attribute in the suppression specification. >> >> I think either 1/ or 2/ should work, but it'd be nice to have both. >> >> If you think that suggession holds water, then we should probably >> file a >> bug to add this new feature. > > Why not fix the default? I am not sure what you mean by default. "drop = yes" in the [suppress_type] section of a suppression specification is not meant to be the same feature as --header-files{1,2}. drop = yes really drops *all* types that match the suppression specification. Those types disappear completement from the internal representation. This can be useful to aggressively reduce the size of the internal representation. --header-files{1,2} generates a suppression specification that drop all types that are not defined in header files, but, for class/struct/ types, it does something different. Rather than just droping those struct/class types from the internal representation, it replaces them by a (forward) declaration -- as opposed to the full type definition. So a pointer to that declaration becomes a pointer to an opaque type, in practise. These two features are useful to people in different use cases. If your question is "how to do exactly what --headers-files{1,2} does using suppression specfications", then the official answer today is "you can't". > I am trying to figure out why the command line option is different from > the suppress_type default way of handling drop. And when that default > way of working is actually useful? Being able completly drop types from the IR is mainly used for size optimization purposes. And in that case, you really want to drop the type on the floor, not replace it with something else. I hope this is useful. Cheers,