1e01aa904Sopenharmony_ci######### 2e01aa904Sopenharmony_ciConcepts 3e01aa904Sopenharmony_ci######### 4e01aa904Sopenharmony_ci 5e01aa904Sopenharmony_ci.. _abi_artifacts_label: 6e01aa904Sopenharmony_ci 7e01aa904Sopenharmony_ciABI artifacts 8e01aa904Sopenharmony_ci============= 9e01aa904Sopenharmony_ci 10e01aa904Sopenharmony_ciAn ABI artifact is a relevant part of the ABI of a shared library or 11e01aa904Sopenharmony_ciprogram. Examples of ABI artifacts are exported types, variables, 12e01aa904Sopenharmony_cifunctions, or `ELF`_ symbols exported by a shared library. 13e01aa904Sopenharmony_ci 14e01aa904Sopenharmony_ciThe set of ABI artifact for a binary is called an ABI Corpus. 15e01aa904Sopenharmony_ci 16e01aa904Sopenharmony_ci.. _harmfulchangeconcept_label: 17e01aa904Sopenharmony_ci 18e01aa904Sopenharmony_ciHarmful changes 19e01aa904Sopenharmony_ci=============== 20e01aa904Sopenharmony_ci 21e01aa904Sopenharmony_ciA change in the diff report is considered harmful if it might cause 22e01aa904Sopenharmony_ciABI compatibility issues. That is, it might prevent an application 23e01aa904Sopenharmony_cidynamically linked against a given version of a library to keep 24e01aa904Sopenharmony_ciworking with the changed subsequent versions of the same library. 25e01aa904Sopenharmony_ci 26e01aa904Sopenharmony_ci.. _harmlesschangeconcept_label: 27e01aa904Sopenharmony_ci 28e01aa904Sopenharmony_ciHarmless changes 29e01aa904Sopenharmony_ci================ 30e01aa904Sopenharmony_ci 31e01aa904Sopenharmony_ciA change in the diff report is considered harmless if it will not 32e01aa904Sopenharmony_cicause any ABI compatibility issue. That is, it will not prevent an 33e01aa904Sopenharmony_ciapplication dynamically linked against given version of a library to 34e01aa904Sopenharmony_cikeep working with the changed subsequent versions of the same library. 35e01aa904Sopenharmony_ci 36e01aa904Sopenharmony_ciBy default, ``abidiff`` filters harmless changes from the diff report. 37e01aa904Sopenharmony_ci 38e01aa904Sopenharmony_ci.. _suppr_spec_label: 39e01aa904Sopenharmony_ci 40e01aa904Sopenharmony_ciSuppression specifications 41e01aa904Sopenharmony_ci========================== 42e01aa904Sopenharmony_ci 43e01aa904Sopenharmony_ci 44e01aa904Sopenharmony_ciDefinition 45e01aa904Sopenharmony_ci---------- 46e01aa904Sopenharmony_ci 47e01aa904Sopenharmony_ciA suppression specification file is a way for a user to instruct 48e01aa904Sopenharmony_ci:ref:`abidiff <abidiff_label>`, :ref:`abipkgdiff <abipkgdiff_label>` 49e01aa904Sopenharmony_cior any other relevant libabigail tool to avoid emitting reports for 50e01aa904Sopenharmony_cichanges involving certain :ref:`ABI artifacts<abi_artifacts_label>`. 51e01aa904Sopenharmony_ci 52e01aa904Sopenharmony_ciIt contains directives (or specifications) that describe the set of 53e01aa904Sopenharmony_ciABI artifacts to avoid emitting change reports about. 54e01aa904Sopenharmony_ci 55e01aa904Sopenharmony_ciIntroductory examples 56e01aa904Sopenharmony_ci--------------------- 57e01aa904Sopenharmony_ci 58e01aa904Sopenharmony_ciIts syntax is based on a simplified and customized form of `Ini File 59e01aa904Sopenharmony_ciSyntax`_. For instance, to specify that change reports on a type 60e01aa904Sopenharmony_cinamed FooPrivateType should be suppressed, one could write this 61e01aa904Sopenharmony_cisuppression specification: :: 62e01aa904Sopenharmony_ci 63e01aa904Sopenharmony_ci [suppress_type] 64e01aa904Sopenharmony_ci name = FooPrivateType 65e01aa904Sopenharmony_ci 66e01aa904Sopenharmony_ciIf we want to ensure that only change reports about structures named 67e01aa904Sopenharmony_ciFooPrivateType should be suppressed, we could write: :: 68e01aa904Sopenharmony_ci 69e01aa904Sopenharmony_ci [suppress_type] 70e01aa904Sopenharmony_ci type_kind = struct 71e01aa904Sopenharmony_ci name = FooPrivateType 72e01aa904Sopenharmony_ci 73e01aa904Sopenharmony_ciBut we could also want to suppress change reports avoid typedefs named 74e01aa904Sopenharmony_ciFooPrivateType. In that case we would write: :: 75e01aa904Sopenharmony_ci 76e01aa904Sopenharmony_ci [suppress_type] 77e01aa904Sopenharmony_ci type_kind = typedef 78e01aa904Sopenharmony_ci name = FooPrivateType 79e01aa904Sopenharmony_ci 80e01aa904Sopenharmony_ciOr, we could want to suppress change reports about all struct which 81e01aa904Sopenharmony_cinames end with the string "PrivateType": :: 82e01aa904Sopenharmony_ci 83e01aa904Sopenharmony_ci [suppress_type] 84e01aa904Sopenharmony_ci type_kind = struct 85e01aa904Sopenharmony_ci name_regexp = ^.*PrivateType 86e01aa904Sopenharmony_ci 87e01aa904Sopenharmony_ciLet's now look at the generic syntax of suppression specification 88e01aa904Sopenharmony_cifiles. 89e01aa904Sopenharmony_ci 90e01aa904Sopenharmony_ciSyntax 91e01aa904Sopenharmony_ci------ 92e01aa904Sopenharmony_ci 93e01aa904Sopenharmony_ciProperties 94e01aa904Sopenharmony_ci^^^^^^^^^^ 95e01aa904Sopenharmony_ci 96e01aa904Sopenharmony_ciMore generally, the format of suppression lists is organized around 97e01aa904Sopenharmony_cithe concept of `property`. Every property has a name and a value, 98e01aa904Sopenharmony_cidelimited by the ``=`` sign. E.g: :: 99e01aa904Sopenharmony_ci 100e01aa904Sopenharmony_ci name = value 101e01aa904Sopenharmony_ci 102e01aa904Sopenharmony_ciLeading and trailing white spaces are ignored around property names 103e01aa904Sopenharmony_ciand values. 104e01aa904Sopenharmony_ci 105e01aa904Sopenharmony_ci.. _suppr_regexp_label: 106e01aa904Sopenharmony_ci 107e01aa904Sopenharmony_ciRegular expressions 108e01aa904Sopenharmony_ci^^^^^^^^^^^^^^^^^^^ 109e01aa904Sopenharmony_ci 110e01aa904Sopenharmony_ciThe value of some properties might be a regular expression. In that 111e01aa904Sopenharmony_cicase, they must comply with the syntax of `extended POSIX regular 112e01aa904Sopenharmony_ciexpressions 113e01aa904Sopenharmony_ci<http://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002dextended-regular-expression-syntax.html#posix_002dextended-regular-expression-syntax>`_. 114e01aa904Sopenharmony_ciNote that Libabigail uses the regular expression engine of the `GNU C 115e01aa904Sopenharmony_ciLibrary`_. 116e01aa904Sopenharmony_ci 117e01aa904Sopenharmony_ciEscaping a character in a regular expression 118e01aa904Sopenharmony_ci^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 119e01aa904Sopenharmony_ci 120e01aa904Sopenharmony_ciWhen trying to match a string that contains a ``*`` character, like in 121e01aa904Sopenharmony_cithe pointer type ``int*``, one must be careful to notice that the 122e01aa904Sopenharmony_cicharacter ``*`` is a special character in the extended POSIX regular 123e01aa904Sopenharmony_ciexpression syntax. And that character must be escaped for the regular 124e01aa904Sopenharmony_ciexpression engine. Thus the regular expression that would match the 125e01aa904Sopenharmony_cistring ``int*`` in a suppression file should be :: 126e01aa904Sopenharmony_ci 127e01aa904Sopenharmony_ci int\\* 128e01aa904Sopenharmony_ci 129e01aa904Sopenharmony_ciWait; but then why the two ``\`` characters? Well, because the ``\`` 130e01aa904Sopenharmony_cicharacter is a special character in the `Ini File Syntax`_ used for 131e01aa904Sopenharmony_cispecifying suppressions. So it must be escaped as well, so that the 132e01aa904Sopenharmony_ciIni File parser leaves a ``\`` character intact in the data stream 133e01aa904Sopenharmony_cithat is handed to the regular expression engine. Hence the ``\\`` 134e01aa904Sopenharmony_citargeted at the Ini File parser. 135e01aa904Sopenharmony_ci 136e01aa904Sopenharmony_ciSo, in short, to escape a character in a regular expression, always 137e01aa904Sopenharmony_ciprefix the character with the ``\\`` sequence. 138e01aa904Sopenharmony_ci 139e01aa904Sopenharmony_ciModus operandi 140e01aa904Sopenharmony_ci^^^^^^^^^^^^^^ 141e01aa904Sopenharmony_ci 142e01aa904Sopenharmony_ci 143e01aa904Sopenharmony_ciSuppression specifications can be applied at two different points of 144e01aa904Sopenharmony_cithe processing pipeline of libabigail. 145e01aa904Sopenharmony_ci 146e01aa904Sopenharmony_ci.. _late_suppression_mode_label: 147e01aa904Sopenharmony_ci 148e01aa904Sopenharmony_ciIn the default operating mode called "late suppression mode", 149e01aa904Sopenharmony_cisuppression specifications are applied to the result of comparing the 150e01aa904Sopenharmony_ciin-memory internal representations of two ABIs. In this mode, if an 151e01aa904Sopenharmony_ciABI artifact matches a suppression specification, its changes are not 152e01aa904Sopenharmony_cimentioned in the ABI change report. The internal representation of 153e01aa904Sopenharmony_cithe "suppressed" changed ABI artifact is still present in memory; it 154e01aa904Sopenharmony_ciis just not mentioned in the ABI change report. The change report can 155e01aa904Sopenharmony_cistill mention statistics about the number of changed ABI artifacts 156e01aa904Sopenharmony_cithat were suppressed. 157e01aa904Sopenharmony_ci 158e01aa904Sopenharmony_ci.. _early_suppression_mode_label: 159e01aa904Sopenharmony_ci 160e01aa904Sopenharmony_ciThere is another operating mode called the "early suppression mode" 161e01aa904Sopenharmony_ciwhere suppression specifications are applied during the construction 162e01aa904Sopenharmony_ciof the in-memory internal representation of a given ABI. In that 163e01aa904Sopenharmony_cimode, if an ABI artifact matches a suppression specification, no 164e01aa904Sopenharmony_ciin-memory internal representation is built for it. As a result, no 165e01aa904Sopenharmony_cichange about the matched ABI artifact is going to be mentioned in the 166e01aa904Sopenharmony_ciABI change report and no statistic about the number of suppressed ABI 167e01aa904Sopenharmony_cichanges is available. Also, please note that because suppressed ABI 168e01aa904Sopenharmony_ciartifacts are removed from the in-memory internal representation in 169e01aa904Sopenharmony_cithis mode, the amount memory used by the internal representation is 170e01aa904Sopenharmony_cipotentially smaller than the memory consumption in the late 171e01aa904Sopenharmony_cisuppression mode. 172e01aa904Sopenharmony_ci 173e01aa904Sopenharmony_ciSections 174e01aa904Sopenharmony_ci^^^^^^^^ 175e01aa904Sopenharmony_ci 176e01aa904Sopenharmony_ciProperties are then grouped into arbitrarily named sections that shall 177e01aa904Sopenharmony_cinot be nested. The name of the section is on a line by itself and is 178e01aa904Sopenharmony_cisurrounded by square brackets, i.e: :: 179e01aa904Sopenharmony_ci 180e01aa904Sopenharmony_ci [section_name] 181e01aa904Sopenharmony_ci property1_name = property1_value 182e01aa904Sopenharmony_ci property2_name = property2_value 183e01aa904Sopenharmony_ci 184e01aa904Sopenharmony_ci 185e01aa904Sopenharmony_ciA section might or might not have properties. Sections that expect to 186e01aa904Sopenharmony_cihave properties and which are found nonetheless empty are just 187e01aa904Sopenharmony_ciignored. Properties that are not recognized by the reader are ignored 188e01aa904Sopenharmony_cias well. 189e01aa904Sopenharmony_ci 190e01aa904Sopenharmony_ciSection names 191e01aa904Sopenharmony_ci^^^^^^^^^^^^^ 192e01aa904Sopenharmony_ci 193e01aa904Sopenharmony_ciEach different section can be thought of as being a directive to 194e01aa904Sopenharmony_cisuppress ABI change reports for a particular kind of ABI artifact. 195e01aa904Sopenharmony_ci 196e01aa904Sopenharmony_ci``[suppress_file]`` 197e01aa904Sopenharmony_ci$$$$$$$$$$$$$$$$$$$ 198e01aa904Sopenharmony_ci 199e01aa904Sopenharmony_ciThis directive prevents a given tool from loading a file (binary or 200e01aa904Sopenharmony_ciabixml file) if its file name or other properties match certain 201e01aa904Sopenharmony_ciproperties. Thus, if the tool is meant to compare the ABIs of two 202e01aa904Sopenharmony_cifiles, and if the directive prevents it from loading either one of the 203e01aa904Sopenharmony_cifiles, then no comparison is performed. 204e01aa904Sopenharmony_ci 205e01aa904Sopenharmony_ciNote that for the ``[suppress_file]`` directive to work, at least one 206e01aa904Sopenharmony_ciof the following properties must be provided: 207e01aa904Sopenharmony_ci 208e01aa904Sopenharmony_ci ``file_name_regexp``, ``file_name_not_regexp``, ``soname_regexp``, 209e01aa904Sopenharmony_ci ``soname_not_regexp``. 210e01aa904Sopenharmony_ci 211e01aa904Sopenharmony_ciIf none of the above properties are provided, then the 212e01aa904Sopenharmony_ci``[suppress_file]`` directive is simply ignored. 213e01aa904Sopenharmony_ci 214e01aa904Sopenharmony_ciThe potential properties of this sections are listed below: 215e01aa904Sopenharmony_ci 216e01aa904Sopenharmony_ci* ``file_name_regexp`` 217e01aa904Sopenharmony_ci 218e01aa904Sopenharmony_ci Usage: 219e01aa904Sopenharmony_ci 220e01aa904Sopenharmony_ci ``file_name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 221e01aa904Sopenharmony_ci 222e01aa904Sopenharmony_ci Prevents the system from loading the file which name matches the 223e01aa904Sopenharmony_ci regular expression specified as value of this property. 224e01aa904Sopenharmony_ci 225e01aa904Sopenharmony_ci* ``file_name_not_regexp`` 226e01aa904Sopenharmony_ci 227e01aa904Sopenharmony_ci Usage: 228e01aa904Sopenharmony_ci 229e01aa904Sopenharmony_ci ``file_name_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 230e01aa904Sopenharmony_ci 231e01aa904Sopenharmony_ci Prevents the system from loading the file which name does not match 232e01aa904Sopenharmony_ci the regular expression specified as value of this property. 233e01aa904Sopenharmony_ci 234e01aa904Sopenharmony_ci 235e01aa904Sopenharmony_ci* ``soname_regexp`` 236e01aa904Sopenharmony_ci 237e01aa904Sopenharmony_ci Usage: 238e01aa904Sopenharmony_ci 239e01aa904Sopenharmony_ci ``soname_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 240e01aa904Sopenharmony_ci 241e01aa904Sopenharmony_ci Prevents the system from loading the file which contains a SONAME 242e01aa904Sopenharmony_ci property that matches the regular expression of this property. Note 243e01aa904Sopenharmony_ci that this property also works on an abixml file if it contains a 244e01aa904Sopenharmony_ci SONAME property. 245e01aa904Sopenharmony_ci 246e01aa904Sopenharmony_ci* ``soname_not_regexp`` 247e01aa904Sopenharmony_ci 248e01aa904Sopenharmony_ci Usage: 249e01aa904Sopenharmony_ci 250e01aa904Sopenharmony_ci ``soname_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 251e01aa904Sopenharmony_ci 252e01aa904Sopenharmony_ci Prevents the system from loading the file which contains a SONAME 253e01aa904Sopenharmony_ci property that does *NOT* match the regular expression of this 254e01aa904Sopenharmony_ci property. Note that this property also works on an abixml file if 255e01aa904Sopenharmony_ci it contains a SONAME property. 256e01aa904Sopenharmony_ci 257e01aa904Sopenharmony_ci* ``label`` 258e01aa904Sopenharmony_ci 259e01aa904Sopenharmony_ci Usage: 260e01aa904Sopenharmony_ci 261e01aa904Sopenharmony_ci ``label`` ``=`` <some-value> 262e01aa904Sopenharmony_ci 263e01aa904Sopenharmony_ci Define a label for the section. A label is just an informative 264e01aa904Sopenharmony_ci string that might be used by the tool to refer to a type suppression 265e01aa904Sopenharmony_ci in error messages. 266e01aa904Sopenharmony_ci 267e01aa904Sopenharmony_ci``[suppress_type]`` 268e01aa904Sopenharmony_ci$$$$$$$$$$$$$$$$$$$ 269e01aa904Sopenharmony_ci 270e01aa904Sopenharmony_ciThis directive suppresses report messages about a type change. 271e01aa904Sopenharmony_ci 272e01aa904Sopenharmony_ciNote that for the ``[suppress_type]`` directive to work, at least one 273e01aa904Sopenharmony_ciof the following properties must be provided: 274e01aa904Sopenharmony_ci 275e01aa904Sopenharmony_ci ``file_name_regexp``, ``file_name_not_regexp``, ``soname_regexp``, 276e01aa904Sopenharmony_ci ``soname_not_regexp``, ``name``, ``name_regexp``, 277e01aa904Sopenharmony_ci ``name_not_regexp``, ``type_kind``, ``source_location_not_in``, 278e01aa904Sopenharmony_ci ``source_location_not_regexp``. 279e01aa904Sopenharmony_ci 280e01aa904Sopenharmony_ciIf none of the above properties are provided, then the 281e01aa904Sopenharmony_ci``[suppress_type]`` directive is simply ignored. 282e01aa904Sopenharmony_ci 283e01aa904Sopenharmony_ciThe potential properties of this sections are listed below: 284e01aa904Sopenharmony_ci 285e01aa904Sopenharmony_ci* ``file_name_regexp`` 286e01aa904Sopenharmony_ci 287e01aa904Sopenharmony_ci Usage: 288e01aa904Sopenharmony_ci 289e01aa904Sopenharmony_ci ``file_name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 290e01aa904Sopenharmony_ci 291e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 292e01aa904Sopenharmony_ci binary file which name matches the regular expression specified as 293e01aa904Sopenharmony_ci value of this property. 294e01aa904Sopenharmony_ci 295e01aa904Sopenharmony_ci* ``file_name_not_regexp`` 296e01aa904Sopenharmony_ci 297e01aa904Sopenharmony_ci Usage: 298e01aa904Sopenharmony_ci 299e01aa904Sopenharmony_ci ``file_name_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 300e01aa904Sopenharmony_ci 301e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 302e01aa904Sopenharmony_ci binary file which name does not match the regular expression 303e01aa904Sopenharmony_ci specified as value of this property. 304e01aa904Sopenharmony_ci 305e01aa904Sopenharmony_ci 306e01aa904Sopenharmony_ci* ``soname_regexp`` 307e01aa904Sopenharmony_ci 308e01aa904Sopenharmony_ci Usage: 309e01aa904Sopenharmony_ci 310e01aa904Sopenharmony_ci ``soname_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 311e01aa904Sopenharmony_ci 312e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 313e01aa904Sopenharmony_ci shared library which SONAME property matches the regular expression 314e01aa904Sopenharmony_ci specified as value of this property. 315e01aa904Sopenharmony_ci 316e01aa904Sopenharmony_ci* ``soname_not_regexp`` 317e01aa904Sopenharmony_ci 318e01aa904Sopenharmony_ci Usage: 319e01aa904Sopenharmony_ci 320e01aa904Sopenharmony_ci ``soname_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 321e01aa904Sopenharmony_ci 322e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 323e01aa904Sopenharmony_ci shared library which SONAME property does not match the regular 324e01aa904Sopenharmony_ci expression specified as value of this property. 325e01aa904Sopenharmony_ci 326e01aa904Sopenharmony_ci* ``name_regexp`` 327e01aa904Sopenharmony_ci 328e01aa904Sopenharmony_ci Usage: 329e01aa904Sopenharmony_ci 330e01aa904Sopenharmony_ci ``name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 331e01aa904Sopenharmony_ci 332e01aa904Sopenharmony_ci Suppresses change reports involving types whose name matches the 333e01aa904Sopenharmony_ci regular expression specified as value of this property. 334e01aa904Sopenharmony_ci 335e01aa904Sopenharmony_ci 336e01aa904Sopenharmony_ci* ``name_not_regexp`` 337e01aa904Sopenharmony_ci 338e01aa904Sopenharmony_ci Usage: 339e01aa904Sopenharmony_ci 340e01aa904Sopenharmony_ci ``name_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 341e01aa904Sopenharmony_ci 342e01aa904Sopenharmony_ci Suppresses change reports involving types whose name does *NOT* match 343e01aa904Sopenharmony_ci the regular expression specified as value of this property. Said 344e01aa904Sopenharmony_ci otherwise, this property specifies which types to keep, rather than 345e01aa904Sopenharmony_ci types to suppress from reports. 346e01aa904Sopenharmony_ci 347e01aa904Sopenharmony_ci* ``name`` 348e01aa904Sopenharmony_ci 349e01aa904Sopenharmony_ci Usage: 350e01aa904Sopenharmony_ci 351e01aa904Sopenharmony_ci ``name`` ``=`` <a-value> 352e01aa904Sopenharmony_ci 353e01aa904Sopenharmony_ci Suppresses change reports involving types whose name equals the value 354e01aa904Sopenharmony_ci of this property. 355e01aa904Sopenharmony_ci 356e01aa904Sopenharmony_ci* ``type_kind`` 357e01aa904Sopenharmony_ci 358e01aa904Sopenharmony_ci Usage: 359e01aa904Sopenharmony_ci 360e01aa904Sopenharmony_ci ``type_kind`` ``=`` ``class`` | ``struct`` | ``union`` | ``enum`` | 361e01aa904Sopenharmony_ci ``array`` | ``typedef`` | ``builtin`` 362e01aa904Sopenharmony_ci 363e01aa904Sopenharmony_ci Suppresses change reports involving a certain kind of type. The kind 364e01aa904Sopenharmony_ci of type to suppress change reports for is specified by the possible 365e01aa904Sopenharmony_ci values listed above: 366e01aa904Sopenharmony_ci 367e01aa904Sopenharmony_ci - ``class``: suppress change reports for class types. Note that 368e01aa904Sopenharmony_ci even if class types don't exist for C, this value still 369e01aa904Sopenharmony_ci triggers the suppression of change reports for struct types, 370e01aa904Sopenharmony_ci in C. In C++ however, it should do what it suggests. 371e01aa904Sopenharmony_ci 372e01aa904Sopenharmony_ci - ``struct``: suppress change reports for struct types in C or C++. 373e01aa904Sopenharmony_ci Note that the value ``class`` above is a super-set of this 374e01aa904Sopenharmony_ci one. 375e01aa904Sopenharmony_ci 376e01aa904Sopenharmony_ci - ``union``: suppress change reports for union types. 377e01aa904Sopenharmony_ci 378e01aa904Sopenharmony_ci - ``enum``: suppress change reports for enum types. 379e01aa904Sopenharmony_ci 380e01aa904Sopenharmony_ci - ``array``: suppress change reports for array types. 381e01aa904Sopenharmony_ci 382e01aa904Sopenharmony_ci - ``typedef``: suppress change reports for typedef types. 383e01aa904Sopenharmony_ci 384e01aa904Sopenharmony_ci - ``builtin``: suppress change reports for built-in (or native) 385e01aa904Sopenharmony_ci types. Example of built-in types are char, int, unsigned int, 386e01aa904Sopenharmony_ci etc. 387e01aa904Sopenharmony_ci 388e01aa904Sopenharmony_ci .. _suppr_source_location_not_in_label: 389e01aa904Sopenharmony_ci 390e01aa904Sopenharmony_ci* ``source_location_not_in`` 391e01aa904Sopenharmony_ci 392e01aa904Sopenharmony_ci Usage: 393e01aa904Sopenharmony_ci 394e01aa904Sopenharmony_ci ``source_location_not_in`` ``=`` <``list-of-file-paths``> 395e01aa904Sopenharmony_ci 396e01aa904Sopenharmony_ci Suppresses change reports involving a type which is defined in a file 397e01aa904Sopenharmony_ci which path is *NOT* listed in the value ``list-of-file-paths``. Note 398e01aa904Sopenharmony_ci that the value is a comma-separated list of file paths e.g, this 399e01aa904Sopenharmony_ci property :: 400e01aa904Sopenharmony_ci 401e01aa904Sopenharmony_ci source_location_not_in = libabigail/abg-ir.h, libabigail/abg-dwarf-reader.h 402e01aa904Sopenharmony_ci 403e01aa904Sopenharmony_ci suppresses change reports about all the types that are *NOT* defined 404e01aa904Sopenharmony_ci in header files whose path end up with the strings 405e01aa904Sopenharmony_ci libabigail/abg-ir.h or libabigail/abg-dwarf-reader.h. 406e01aa904Sopenharmony_ci 407e01aa904Sopenharmony_ci .. _suppr_source_location_not_regexp_label: 408e01aa904Sopenharmony_ci 409e01aa904Sopenharmony_ci* ``source_location_not_regexp`` 410e01aa904Sopenharmony_ci 411e01aa904Sopenharmony_ci Usage: 412e01aa904Sopenharmony_ci 413e01aa904Sopenharmony_ci ``source_location_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 414e01aa904Sopenharmony_ci 415e01aa904Sopenharmony_ci Suppresses change reports involving a type which is defined in a file 416e01aa904Sopenharmony_ci which path does *NOT* match the :ref:`regular expression 417e01aa904Sopenharmony_ci <suppr_regexp_label>` provided as value of the property. E.g, this 418e01aa904Sopenharmony_ci property :: 419e01aa904Sopenharmony_ci 420e01aa904Sopenharmony_ci source_location_not_regexp = libabigail/abg-.*\\.h 421e01aa904Sopenharmony_ci 422e01aa904Sopenharmony_ci suppresses change reports involving all the types that are *NOT* 423e01aa904Sopenharmony_ci defined in header files whose path match the regular expression 424e01aa904Sopenharmony_ci provided a value of the property. 425e01aa904Sopenharmony_ci 426e01aa904Sopenharmony_ci .. _suppr_has_data_member_inserted_at_label: 427e01aa904Sopenharmony_ci 428e01aa904Sopenharmony_ci* ``has_data_member_inserted_at`` 429e01aa904Sopenharmony_ci 430e01aa904Sopenharmony_ci Usage: 431e01aa904Sopenharmony_ci 432e01aa904Sopenharmony_ci ``has_data_member_inserted_at`` ``=`` <``offset-in-bit``> 433e01aa904Sopenharmony_ci 434e01aa904Sopenharmony_ci Suppresses change reports involving a type which has at least one 435e01aa904Sopenharmony_ci data member inserted at an offset specified by the property value 436e01aa904Sopenharmony_ci ``offset-in-bit``. Please note that if a type has a change in which 437e01aa904Sopenharmony_ci at least one of its data members is removed or its size is reduced, 438e01aa904Sopenharmony_ci the type will *NOT* be suppressed by the evaluation of this property. 439e01aa904Sopenharmony_ci 440e01aa904Sopenharmony_ci The value ``offset-in-bit`` is either: 441e01aa904Sopenharmony_ci 442e01aa904Sopenharmony_ci - an integer value, expressed in bits, which denotes the 443e01aa904Sopenharmony_ci offset of the insertion point of the data member, starting 444e01aa904Sopenharmony_ci from the beginning of the relevant structure or class. 445e01aa904Sopenharmony_ci 446e01aa904Sopenharmony_ci - the keyword ``end`` which is a named constant which value 447e01aa904Sopenharmony_ci equals the offset of the end of the of the structure or 448e01aa904Sopenharmony_ci class. 449e01aa904Sopenharmony_ci 450e01aa904Sopenharmony_ci - the function call expression 451e01aa904Sopenharmony_ci ``offset_of(data-member-name)`` where `data-member-name` is 452e01aa904Sopenharmony_ci the name of a given data member of the relevant structure 453e01aa904Sopenharmony_ci or class. The value of this function call expression is an 454e01aa904Sopenharmony_ci integer that represents the offset of the data member 455e01aa904Sopenharmony_ci denoted by ``data-member-name``. 456e01aa904Sopenharmony_ci 457e01aa904Sopenharmony_ci - the function call expression 458e01aa904Sopenharmony_ci ``offset_after(data-member-name)`` where `data-member-name` 459e01aa904Sopenharmony_ci is the name of a given data member of the relevant 460e01aa904Sopenharmony_ci structure or class. The value of this function call 461e01aa904Sopenharmony_ci expression is an integer that represents the offset of the 462e01aa904Sopenharmony_ci point that comes right after the region occupied by the 463e01aa904Sopenharmony_ci data member denoted by ``data-member-name``. 464e01aa904Sopenharmony_ci 465e01aa904Sopenharmony_ci .. _suppr_has_data_member_inserted_between_label: 466e01aa904Sopenharmony_ci 467e01aa904Sopenharmony_ci 468e01aa904Sopenharmony_ci* ``has_data_member_inserted_between`` 469e01aa904Sopenharmony_ci 470e01aa904Sopenharmony_ci Usage: 471e01aa904Sopenharmony_ci 472e01aa904Sopenharmony_ci ``has_data_member_inserted_between`` ``=`` {<``range-begin``>, <``range-end``>} 473e01aa904Sopenharmony_ci 474e01aa904Sopenharmony_ci Suppresses change reports involving a type which has at least one 475e01aa904Sopenharmony_ci data member inserted at an offset that is comprised in the range 476e01aa904Sopenharmony_ci between ``range-begin`` and ``range-end``. Please note that each of 477e01aa904Sopenharmony_ci the values ``range-begin`` and ``range-end`` can be of the same form 478e01aa904Sopenharmony_ci as the :ref:`has_data_member_inserted_at 479e01aa904Sopenharmony_ci <suppr_has_data_member_inserted_at_label>` property above. Please 480e01aa904Sopenharmony_ci also note that if a type has a change in which at least one of its 481e01aa904Sopenharmony_ci data members is removed or its size is reduced, the type will *NOT* be 482e01aa904Sopenharmony_ci suppressed by the evaluation of this property. 483e01aa904Sopenharmony_ci 484e01aa904Sopenharmony_ci Usage examples of this properties are: :: 485e01aa904Sopenharmony_ci 486e01aa904Sopenharmony_ci has_data_member_inserted_between = {8, 64} 487e01aa904Sopenharmony_ci 488e01aa904Sopenharmony_ci or: :: 489e01aa904Sopenharmony_ci 490e01aa904Sopenharmony_ci has_data_member_inserted_between = {16, end} 491e01aa904Sopenharmony_ci 492e01aa904Sopenharmony_ci or: :: 493e01aa904Sopenharmony_ci 494e01aa904Sopenharmony_ci has_data_member_inserted_between = {offset_after(member1), end} 495e01aa904Sopenharmony_ci 496e01aa904Sopenharmony_ci.. _suppr_has_data_members_inserted_between_label: 497e01aa904Sopenharmony_ci 498e01aa904Sopenharmony_ci 499e01aa904Sopenharmony_ci* ``has_data_members_inserted_between`` 500e01aa904Sopenharmony_ci 501e01aa904Sopenharmony_ci Usage: 502e01aa904Sopenharmony_ci 503e01aa904Sopenharmony_ci ``has_data_members_inserted_between`` ``=`` {<sequence-of-ranges>} 504e01aa904Sopenharmony_ci 505e01aa904Sopenharmony_ci Suppresses change reports involving a type which has multiple data 506e01aa904Sopenharmony_ci member inserted in various offset ranges. A usage example of this 507e01aa904Sopenharmony_ci property is, for instance: :: 508e01aa904Sopenharmony_ci 509e01aa904Sopenharmony_ci has_data_members_inserted_between = {{8, 31}, {72, 95}} 510e01aa904Sopenharmony_ci 511e01aa904Sopenharmony_ci This usage example suppresses change reports involving a type which 512e01aa904Sopenharmony_ci has data members inserted in bit offset ranges [8 31] and [72 95]. 513e01aa904Sopenharmony_ci The length of the sequence of ranges or this 514e01aa904Sopenharmony_ci ``has_data_members_inserted_between`` is not bounded; it can be as 515e01aa904Sopenharmony_ci long as the system can cope with. The values of the boundaries of 516e01aa904Sopenharmony_ci the ranges are of the same kind as for the 517e01aa904Sopenharmony_ci :ref:`has_data_member_inserted_at 518e01aa904Sopenharmony_ci <suppr_has_data_member_inserted_at_label>` property above. Please 519e01aa904Sopenharmony_ci note that if a type has a change in which at least one of its data 520e01aa904Sopenharmony_ci members is removed or its size is reduced, the type will *NOT* be 521e01aa904Sopenharmony_ci suppressed by the evaluation of this property. 522e01aa904Sopenharmony_ci 523e01aa904Sopenharmony_ci Another usage example of this property is thus: :: 524e01aa904Sopenharmony_ci 525e01aa904Sopenharmony_ci has_data_members_inserted_between = 526e01aa904Sopenharmony_ci { 527e01aa904Sopenharmony_ci {offset_after(member0), offset_of(member1)}, 528e01aa904Sopenharmony_ci {72, end} 529e01aa904Sopenharmony_ci } 530e01aa904Sopenharmony_ci 531e01aa904Sopenharmony_ci .. _suppr_accessed_through_property_label: 532e01aa904Sopenharmony_ci 533e01aa904Sopenharmony_ci* ``accessed_through`` 534e01aa904Sopenharmony_ci 535e01aa904Sopenharmony_ci Usage: 536e01aa904Sopenharmony_ci 537e01aa904Sopenharmony_ci ``accessed_through`` ``=`` <some-predefined-values> 538e01aa904Sopenharmony_ci 539e01aa904Sopenharmony_ci Suppress change reports involving a type which is referred to either 540e01aa904Sopenharmony_ci directly or through a pointer or a reference. The potential values 541e01aa904Sopenharmony_ci of this property are the predefined keywords below: 542e01aa904Sopenharmony_ci 543e01aa904Sopenharmony_ci * ``direct`` 544e01aa904Sopenharmony_ci 545e01aa904Sopenharmony_ci So if the ``[suppress_type]`` contains the property 546e01aa904Sopenharmony_ci description: :: 547e01aa904Sopenharmony_ci 548e01aa904Sopenharmony_ci accessed_through = direct 549e01aa904Sopenharmony_ci 550e01aa904Sopenharmony_ci then changes about a type that is referred-to 551e01aa904Sopenharmony_ci directly (i.e, not through a pointer or a reference) 552e01aa904Sopenharmony_ci are going to be suppressed. 553e01aa904Sopenharmony_ci 554e01aa904Sopenharmony_ci * ``pointer`` 555e01aa904Sopenharmony_ci 556e01aa904Sopenharmony_ci If the ``accessed_through`` property is set to the 557e01aa904Sopenharmony_ci value ``pointer`` then changes about a type that is 558e01aa904Sopenharmony_ci referred-to through a pointer are going to be 559e01aa904Sopenharmony_ci suppressed. 560e01aa904Sopenharmony_ci 561e01aa904Sopenharmony_ci * ``reference`` 562e01aa904Sopenharmony_ci 563e01aa904Sopenharmony_ci If the ``accessed_through`` property is set to the 564e01aa904Sopenharmony_ci value ``reference`` then changes about a type that is 565e01aa904Sopenharmony_ci referred-to through a reference are going to be 566e01aa904Sopenharmony_ci suppressed. 567e01aa904Sopenharmony_ci 568e01aa904Sopenharmony_ci * ``reference-or-pointer`` 569e01aa904Sopenharmony_ci 570e01aa904Sopenharmony_ci If the ``accessed_through`` property is set to the 571e01aa904Sopenharmony_ci value ``reference-or-pointer`` then changes about a 572e01aa904Sopenharmony_ci type that is referred-to through either a reference 573e01aa904Sopenharmony_ci or a pointer are going to be suppressed. 574e01aa904Sopenharmony_ci 575e01aa904Sopenharmony_ci For an extensive example of how to use this property, please check 576e01aa904Sopenharmony_ci out the example below about :ref:`suppressing change reports about 577e01aa904Sopenharmony_ci types accessed either directly or through pointers 578e01aa904Sopenharmony_ci <example_accessed_through_label>`. 579e01aa904Sopenharmony_ci 580e01aa904Sopenharmony_ci* ``drop`` 581e01aa904Sopenharmony_ci 582e01aa904Sopenharmony_ci Usage: 583e01aa904Sopenharmony_ci 584e01aa904Sopenharmony_ci ``drop`` ``=`` yes | no 585e01aa904Sopenharmony_ci 586e01aa904Sopenharmony_ci If a type is matched by a suppression specification which contains 587e01aa904Sopenharmony_ci the "drop" property set to "yes" (or to "true") then the type is not 588e01aa904Sopenharmony_ci even going to be represented in the internal representation of the 589e01aa904Sopenharmony_ci ABI being analyzed. This property makes its enclosing suppression 590e01aa904Sopenharmony_ci specification to be applied in the :ref:`early suppression 591e01aa904Sopenharmony_ci specification mode <early_suppression_mode_label>`. The net effect 592e01aa904Sopenharmony_ci is that it potentially reduces the memory used to represent the ABI 593e01aa904Sopenharmony_ci being analyzed. 594e01aa904Sopenharmony_ci 595e01aa904Sopenharmony_ci Please note that for this property to be effective, the enclosing 596e01aa904Sopenharmony_ci suppression specification must have at least one of the following 597e01aa904Sopenharmony_ci properties specified: ``name_regexp``, ``name``, ``name_regexp``, 598e01aa904Sopenharmony_ci ``source_location_not_in`` or ``source_location_not_regexp``. 599e01aa904Sopenharmony_ci 600e01aa904Sopenharmony_ci .. _suppr_label_property_label: 601e01aa904Sopenharmony_ci 602e01aa904Sopenharmony_ci* ``label`` 603e01aa904Sopenharmony_ci 604e01aa904Sopenharmony_ci Usage: 605e01aa904Sopenharmony_ci 606e01aa904Sopenharmony_ci ``label`` ``=`` <some-value> 607e01aa904Sopenharmony_ci 608e01aa904Sopenharmony_ci Define a label for the section. A label is just an informative 609e01aa904Sopenharmony_ci string that might be used by a tool to refer to a type suppression in 610e01aa904Sopenharmony_ci error messages. 611e01aa904Sopenharmony_ci 612e01aa904Sopenharmony_ci.. _suppr_changed_enumerators_label: 613e01aa904Sopenharmony_ci 614e01aa904Sopenharmony_ci* ``changed_enumerators`` 615e01aa904Sopenharmony_ci 616e01aa904Sopenharmony_ci Usage: 617e01aa904Sopenharmony_ci 618e01aa904Sopenharmony_ci ``changed_enumerators`` ``=`` <list-of-enumerators> 619e01aa904Sopenharmony_ci 620e01aa904Sopenharmony_ci Suppresses change reports involving changes in the value of 621e01aa904Sopenharmony_ci enumerators of a given enum type. This property is applied if the 622e01aa904Sopenharmony_ci ``type_kind`` property is set to the value ``enum``, at least. The 623e01aa904Sopenharmony_ci value of the ``changed_enumerators`` is a comma-separated list of 624e01aa904Sopenharmony_ci the enumerators that the user expects to change. For instance: :: 625e01aa904Sopenharmony_ci 626e01aa904Sopenharmony_ci changed_enumerators = LAST_ENUMERATORS0, LAST_ENUMERATOR1 627e01aa904Sopenharmony_ci 628e01aa904Sopenharmony_ci``[suppress_function]`` 629e01aa904Sopenharmony_ci$$$$$$$$$$$$$$$$$$$$$$$$ 630e01aa904Sopenharmony_ci 631e01aa904Sopenharmony_ciThis directive suppresses report messages about changes on a set of 632e01aa904Sopenharmony_cifunctions. 633e01aa904Sopenharmony_ci 634e01aa904Sopenharmony_ciNote that for the ``[suppress_function]`` directive to work, at least 635e01aa904Sopenharmony_cione of the following properties must be provided: 636e01aa904Sopenharmony_ci 637e01aa904Sopenharmony_ci ``label``, ``file_name_regexp``, ``file_name_not_regexp``, 638e01aa904Sopenharmony_ci ``soname_regexp``, ``soname_not_regexp``, ``name``, ``name_regexp``, 639e01aa904Sopenharmony_ci ``name_not_regexp``, ``parameter``, ``return_type_name``, 640e01aa904Sopenharmony_ci ``return_type_regexp``, ``symbol_name``, ``symbol_name_regexp``, 641e01aa904Sopenharmony_ci ``symbol_name_not_regexp``, ``symbol_version``, 642e01aa904Sopenharmony_ci ``symbol_version_regexp``. 643e01aa904Sopenharmony_ci 644e01aa904Sopenharmony_ciIf none of the above properties are provided, then the 645e01aa904Sopenharmony_ci``[suppress_function]`` directive is simply ignored. 646e01aa904Sopenharmony_ci 647e01aa904Sopenharmony_ciThe potential properties of this sections are: 648e01aa904Sopenharmony_ci 649e01aa904Sopenharmony_ci* ``label`` 650e01aa904Sopenharmony_ci 651e01aa904Sopenharmony_ci Usage: 652e01aa904Sopenharmony_ci 653e01aa904Sopenharmony_ci ``label`` ``=`` <some-value> 654e01aa904Sopenharmony_ci 655e01aa904Sopenharmony_ci This property is the same as the :ref:`label property 656e01aa904Sopenharmony_ci <suppr_label_property_label>` defined above. 657e01aa904Sopenharmony_ci 658e01aa904Sopenharmony_ci 659e01aa904Sopenharmony_ci* ``file_name_regexp`` 660e01aa904Sopenharmony_ci 661e01aa904Sopenharmony_ci Usage: 662e01aa904Sopenharmony_ci 663e01aa904Sopenharmony_ci ``file_name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 664e01aa904Sopenharmony_ci 665e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 666e01aa904Sopenharmony_ci binary file which name matches the regular expression specified as 667e01aa904Sopenharmony_ci value of this property. 668e01aa904Sopenharmony_ci 669e01aa904Sopenharmony_ci 670e01aa904Sopenharmony_ci* ``file_name_not_regexp`` 671e01aa904Sopenharmony_ci 672e01aa904Sopenharmony_ci Usage: 673e01aa904Sopenharmony_ci 674e01aa904Sopenharmony_ci ``file_name_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 675e01aa904Sopenharmony_ci 676e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 677e01aa904Sopenharmony_ci binary file which name does not match the regular expression 678e01aa904Sopenharmony_ci specified as value of this property. 679e01aa904Sopenharmony_ci 680e01aa904Sopenharmony_ci* ``soname_regexp`` 681e01aa904Sopenharmony_ci 682e01aa904Sopenharmony_ci Usage: 683e01aa904Sopenharmony_ci 684e01aa904Sopenharmony_ci ``soname_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 685e01aa904Sopenharmony_ci 686e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 687e01aa904Sopenharmony_ci shared library which SONAME property matches the regular expression 688e01aa904Sopenharmony_ci specified as value of this property. 689e01aa904Sopenharmony_ci 690e01aa904Sopenharmony_ci* ``soname_not_regexp`` 691e01aa904Sopenharmony_ci 692e01aa904Sopenharmony_ci Usage: 693e01aa904Sopenharmony_ci 694e01aa904Sopenharmony_ci ``soname_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 695e01aa904Sopenharmony_ci 696e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 697e01aa904Sopenharmony_ci shared library which SONAME property does not match the regular 698e01aa904Sopenharmony_ci expression specified as value of this property. 699e01aa904Sopenharmony_ci 700e01aa904Sopenharmony_ci 701e01aa904Sopenharmony_ci* ``name`` 702e01aa904Sopenharmony_ci 703e01aa904Sopenharmony_ci Usage: 704e01aa904Sopenharmony_ci 705e01aa904Sopenharmony_ci ``name`` ``=`` <some-value> 706e01aa904Sopenharmony_ci 707e01aa904Sopenharmony_ci Suppresses change reports involving functions whose name equals the 708e01aa904Sopenharmony_ci value of this property. 709e01aa904Sopenharmony_ci 710e01aa904Sopenharmony_ci* ``name_regexp`` 711e01aa904Sopenharmony_ci 712e01aa904Sopenharmony_ci Usage: 713e01aa904Sopenharmony_ci 714e01aa904Sopenharmony_ci ``name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 715e01aa904Sopenharmony_ci 716e01aa904Sopenharmony_ci Suppresses change reports involving functions whose name matches the 717e01aa904Sopenharmony_ci regular expression specified as value of this property. 718e01aa904Sopenharmony_ci 719e01aa904Sopenharmony_ci Let's consider the case of functions that have several symbol names. 720e01aa904Sopenharmony_ci This happens when the underlying symbol for the function has 721e01aa904Sopenharmony_ci aliases. Each symbol name is actually one alias name. 722e01aa904Sopenharmony_ci 723e01aa904Sopenharmony_ci In this case, if the regular expression matches the name of 724e01aa904Sopenharmony_ci at least one of the aliases names, then it must match the names of 725e01aa904Sopenharmony_ci all of the aliases of the function for the directive to actually 726e01aa904Sopenharmony_ci suppress the diff reports for said function. 727e01aa904Sopenharmony_ci 728e01aa904Sopenharmony_ci 729e01aa904Sopenharmony_ci* ``name_not_regexp`` 730e01aa904Sopenharmony_ci 731e01aa904Sopenharmony_ci Usage: 732e01aa904Sopenharmony_ci 733e01aa904Sopenharmony_ci ``name_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 734e01aa904Sopenharmony_ci 735e01aa904Sopenharmony_ci Suppresses change reports involving functions whose names don't match 736e01aa904Sopenharmony_ci the regular expression specified as value of this property. 737e01aa904Sopenharmony_ci 738e01aa904Sopenharmony_ci The rules for functions that have several symbol names are the same 739e01aa904Sopenharmony_ci rules as for the ``name_regexp`` property above. 740e01aa904Sopenharmony_ci 741e01aa904Sopenharmony_ci .. _suppr_change_kind_property_label: 742e01aa904Sopenharmony_ci 743e01aa904Sopenharmony_ci 744e01aa904Sopenharmony_ci* ``change_kind`` 745e01aa904Sopenharmony_ci 746e01aa904Sopenharmony_ci Usage: 747e01aa904Sopenharmony_ci 748e01aa904Sopenharmony_ci ``change_kind`` ``=`` <predefined-possible-values> 749e01aa904Sopenharmony_ci 750e01aa904Sopenharmony_ci Specifies the kind of changes this suppression specification should 751e01aa904Sopenharmony_ci apply to. The possible values of this property as well as their 752e01aa904Sopenharmony_ci meaning are listed below: 753e01aa904Sopenharmony_ci 754e01aa904Sopenharmony_ci - ``function-subtype-change`` 755e01aa904Sopenharmony_ci 756e01aa904Sopenharmony_ci This suppression specification applies to functions 757e01aa904Sopenharmony_ci that which have at least one sub-type that has 758e01aa904Sopenharmony_ci changed. 759e01aa904Sopenharmony_ci 760e01aa904Sopenharmony_ci - ``added-function`` 761e01aa904Sopenharmony_ci 762e01aa904Sopenharmony_ci This suppression specification applies to functions 763e01aa904Sopenharmony_ci that have been added to the binary. 764e01aa904Sopenharmony_ci 765e01aa904Sopenharmony_ci - ``deleted-function`` 766e01aa904Sopenharmony_ci 767e01aa904Sopenharmony_ci This suppression specification applies to functions 768e01aa904Sopenharmony_ci that have been removed from the binary. 769e01aa904Sopenharmony_ci 770e01aa904Sopenharmony_ci - ``all`` 771e01aa904Sopenharmony_ci 772e01aa904Sopenharmony_ci This suppression specification applies to functions 773e01aa904Sopenharmony_ci that have all of the changes above. Note that not 774e01aa904Sopenharmony_ci providing the ``change_kind`` property at all is 775e01aa904Sopenharmony_ci equivalent to setting it to the value ``all``. 776e01aa904Sopenharmony_ci 777e01aa904Sopenharmony_ci 778e01aa904Sopenharmony_ci* ``parameter`` 779e01aa904Sopenharmony_ci 780e01aa904Sopenharmony_ci Usage: 781e01aa904Sopenharmony_ci 782e01aa904Sopenharmony_ci ``parameter`` ``=`` <function-parameter-specification> 783e01aa904Sopenharmony_ci 784e01aa904Sopenharmony_ci Suppresses change reports involving functions whose 785e01aa904Sopenharmony_ci parameters match the parameter specification indicated as 786e01aa904Sopenharmony_ci value of this property. 787e01aa904Sopenharmony_ci 788e01aa904Sopenharmony_ci The format of the function parameter specification is: 789e01aa904Sopenharmony_ci 790e01aa904Sopenharmony_ci ``'`` ``<parameter-index>`` ``<space>`` ``<type-name-or-regular-expression>`` 791e01aa904Sopenharmony_ci 792e01aa904Sopenharmony_ci That is, an apostrophe followed by a number that is the 793e01aa904Sopenharmony_ci index of the parameter, followed by one of several spaces, 794e01aa904Sopenharmony_ci followed by either the name of the type of the parameter, 795e01aa904Sopenharmony_ci or a regular expression describing a family of parameter 796e01aa904Sopenharmony_ci type names. 797e01aa904Sopenharmony_ci 798e01aa904Sopenharmony_ci If the parameter type name is designated by a regular 799e01aa904Sopenharmony_ci expression, then said regular expression must be enclosed 800e01aa904Sopenharmony_ci between two slashes; like ``/some-regular-expression/``. 801e01aa904Sopenharmony_ci 802e01aa904Sopenharmony_ci The index of the first parameter of the function is zero. 803e01aa904Sopenharmony_ci Note that for member functions (methods of classes), the 804e01aa904Sopenharmony_ci this is the first parameter that comes after the implicit 805e01aa904Sopenharmony_ci "this" pointer parameter. 806e01aa904Sopenharmony_ci 807e01aa904Sopenharmony_ci Examples of function parameter specifications are: :: 808e01aa904Sopenharmony_ci 809e01aa904Sopenharmony_ci '0 int 810e01aa904Sopenharmony_ci 811e01aa904Sopenharmony_ci Which means, the parameter at index 0, whose type name is 812e01aa904Sopenharmony_ci ``int``. :: 813e01aa904Sopenharmony_ci 814e01aa904Sopenharmony_ci '4 unsigned char* 815e01aa904Sopenharmony_ci 816e01aa904Sopenharmony_ci Which means, the parameter at index 4, whose type name is 817e01aa904Sopenharmony_ci ``unsigned char*``. :: 818e01aa904Sopenharmony_ci 819e01aa904Sopenharmony_ci '2 /^foo.*&/ 820e01aa904Sopenharmony_ci 821e01aa904Sopenharmony_ci Which means, the parameter at index 2, whose type name 822e01aa904Sopenharmony_ci starts with the string "foo" and ends with an '&'. In 823e01aa904Sopenharmony_ci other words, this is the third parameter and it's a 824e01aa904Sopenharmony_ci reference on a type that starts with the string "foo". 825e01aa904Sopenharmony_ci 826e01aa904Sopenharmony_ci* ``return_type_name`` 827e01aa904Sopenharmony_ci 828e01aa904Sopenharmony_ci Usage: 829e01aa904Sopenharmony_ci 830e01aa904Sopenharmony_ci ``return_type_name`` ``=`` <some-value> 831e01aa904Sopenharmony_ci 832e01aa904Sopenharmony_ci Suppresses change reports involving functions whose return type name 833e01aa904Sopenharmony_ci equals the value of this property. 834e01aa904Sopenharmony_ci 835e01aa904Sopenharmony_ci* ``return_type_regexp`` 836e01aa904Sopenharmony_ci 837e01aa904Sopenharmony_ci Usage: 838e01aa904Sopenharmony_ci 839e01aa904Sopenharmony_ci ``return_type_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 840e01aa904Sopenharmony_ci 841e01aa904Sopenharmony_ci Suppresses change reports involving functions whose return type name 842e01aa904Sopenharmony_ci matches the regular expression specified as value of this property. 843e01aa904Sopenharmony_ci 844e01aa904Sopenharmony_ci* ``symbol_name`` 845e01aa904Sopenharmony_ci 846e01aa904Sopenharmony_ci Usage: 847e01aa904Sopenharmony_ci 848e01aa904Sopenharmony_ci ``symbol_name`` ``=`` <some-value> 849e01aa904Sopenharmony_ci 850e01aa904Sopenharmony_ci Suppresses change reports involving functions whose symbol name equals 851e01aa904Sopenharmony_ci the value of this property. 852e01aa904Sopenharmony_ci 853e01aa904Sopenharmony_ci* ``symbol_name_regexp`` 854e01aa904Sopenharmony_ci 855e01aa904Sopenharmony_ci Usage: 856e01aa904Sopenharmony_ci 857e01aa904Sopenharmony_ci ``symbol_name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 858e01aa904Sopenharmony_ci 859e01aa904Sopenharmony_ci Suppresses change reports involving functions whose symbol name 860e01aa904Sopenharmony_ci matches the regular expression specified as value of this property. 861e01aa904Sopenharmony_ci 862e01aa904Sopenharmony_ci Let's consider the case of functions that have several symbol names. 863e01aa904Sopenharmony_ci This happens when the underlying symbol for the function has 864e01aa904Sopenharmony_ci aliases. Each symbol name is actually one alias name. 865e01aa904Sopenharmony_ci 866e01aa904Sopenharmony_ci In this case, the regular expression must match the names of all of 867e01aa904Sopenharmony_ci the aliases of the function for the directive to actually suppress 868e01aa904Sopenharmony_ci the diff reports for said function. 869e01aa904Sopenharmony_ci 870e01aa904Sopenharmony_ci* ``symbol_name_not_regexp`` 871e01aa904Sopenharmony_ci 872e01aa904Sopenharmony_ci Usage: 873e01aa904Sopenharmony_ci 874e01aa904Sopenharmony_ci ``symbol_name_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 875e01aa904Sopenharmony_ci 876e01aa904Sopenharmony_ci Suppresses change reports involving functions whose symbol name does 877e01aa904Sopenharmony_ci not match the regular expression specified as value of this property. 878e01aa904Sopenharmony_ci 879e01aa904Sopenharmony_ci* ``symbol_version`` 880e01aa904Sopenharmony_ci 881e01aa904Sopenharmony_ci Usage: 882e01aa904Sopenharmony_ci 883e01aa904Sopenharmony_ci ``symbol_version`` ``=`` <some-value> 884e01aa904Sopenharmony_ci 885e01aa904Sopenharmony_ci Suppresses change reports involving functions whose symbol version 886e01aa904Sopenharmony_ci equals the value of this property. 887e01aa904Sopenharmony_ci 888e01aa904Sopenharmony_ci* ``symbol_version_regexp`` 889e01aa904Sopenharmony_ci 890e01aa904Sopenharmony_ci Usage: 891e01aa904Sopenharmony_ci 892e01aa904Sopenharmony_ci ``symbol_version_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 893e01aa904Sopenharmony_ci 894e01aa904Sopenharmony_ci Suppresses change reports involving functions whose symbol version 895e01aa904Sopenharmony_ci matches the regular expression specified as value of this property. 896e01aa904Sopenharmony_ci 897e01aa904Sopenharmony_ci* ``drop`` 898e01aa904Sopenharmony_ci 899e01aa904Sopenharmony_ci Usage: 900e01aa904Sopenharmony_ci 901e01aa904Sopenharmony_ci ``drop`` ``=`` yes | no 902e01aa904Sopenharmony_ci 903e01aa904Sopenharmony_ci If a function is matched by a suppression specification which 904e01aa904Sopenharmony_ci contains the "drop" property set to "yes" (or to "true") then the 905e01aa904Sopenharmony_ci function is not even going to be represented in the internal 906e01aa904Sopenharmony_ci representation of the ABI being analyzed. This property makes its 907e01aa904Sopenharmony_ci enclosing suppression specification to be applied in the :ref:`early 908e01aa904Sopenharmony_ci suppression specification mode <early_suppression_mode_label>`. The 909e01aa904Sopenharmony_ci net effect is that it potentially reduces the memory used to 910e01aa904Sopenharmony_ci represent the ABI being analyzed. 911e01aa904Sopenharmony_ci 912e01aa904Sopenharmony_ci Please note that for this property to be effective, the enclosing 913e01aa904Sopenharmony_ci suppression specification must have at least one of the following 914e01aa904Sopenharmony_ci properties specified: ``name_regexp``, ``name``, ``name_regexp``, 915e01aa904Sopenharmony_ci ``source_location_not_in`` or ``source_location_not_regexp``. 916e01aa904Sopenharmony_ci 917e01aa904Sopenharmony_ci``[suppress_variable]`` 918e01aa904Sopenharmony_ci$$$$$$$$$$$$$$$$$$$$$$$$ 919e01aa904Sopenharmony_ci 920e01aa904Sopenharmony_ciThis directive suppresses report messages about changes on a set of 921e01aa904Sopenharmony_civariables. 922e01aa904Sopenharmony_ci 923e01aa904Sopenharmony_ciNote that for the ``[suppress_variable]`` directive to work, at least 924e01aa904Sopenharmony_cione of the following properties must be provided: 925e01aa904Sopenharmony_ci 926e01aa904Sopenharmony_ci ``label``, ``file_name_regexp``, ``file_name_not_regexp``, 927e01aa904Sopenharmony_ci ``soname_regexp``, ``soname_not_regexp``, ``name``, ``name_regexp``, 928e01aa904Sopenharmony_ci ``name_not_regexp``, ``symbol_name``, ``symbol_name_regexp``, 929e01aa904Sopenharmony_ci ``symbol_name_not_regexp``, ``symbol_version``, 930e01aa904Sopenharmony_ci ``symbol_version_regexp``, ``type_name``, ``type_name_regexp``. 931e01aa904Sopenharmony_ci 932e01aa904Sopenharmony_ciIf none of the above properties are provided, then the 933e01aa904Sopenharmony_ci``[suppress_variable]`` directive is simply ignored. 934e01aa904Sopenharmony_ci 935e01aa904Sopenharmony_ciThe potential properties of this sections are: 936e01aa904Sopenharmony_ci 937e01aa904Sopenharmony_ci* ``label`` 938e01aa904Sopenharmony_ci 939e01aa904Sopenharmony_ci Usage: 940e01aa904Sopenharmony_ci 941e01aa904Sopenharmony_ci ``label`` ``=`` <some-value> 942e01aa904Sopenharmony_ci 943e01aa904Sopenharmony_ci This property is the same as the :ref:`label property 944e01aa904Sopenharmony_ci <suppr_label_property_label>` defined above. 945e01aa904Sopenharmony_ci 946e01aa904Sopenharmony_ci 947e01aa904Sopenharmony_ci* ``file_name_regexp`` 948e01aa904Sopenharmony_ci 949e01aa904Sopenharmony_ci Usage: 950e01aa904Sopenharmony_ci 951e01aa904Sopenharmony_ci ``file_name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 952e01aa904Sopenharmony_ci 953e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 954e01aa904Sopenharmony_ci binary file which name matches the regular expression specified as 955e01aa904Sopenharmony_ci value of this property. 956e01aa904Sopenharmony_ci 957e01aa904Sopenharmony_ci* ``file_name_not_regexp`` 958e01aa904Sopenharmony_ci 959e01aa904Sopenharmony_ci Usage: 960e01aa904Sopenharmony_ci 961e01aa904Sopenharmony_ci ``file_name_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 962e01aa904Sopenharmony_ci 963e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 964e01aa904Sopenharmony_ci binary file which name does not match the regular expression 965e01aa904Sopenharmony_ci specified as value of this property. 966e01aa904Sopenharmony_ci 967e01aa904Sopenharmony_ci 968e01aa904Sopenharmony_ci* ``soname_regexp`` 969e01aa904Sopenharmony_ci 970e01aa904Sopenharmony_ci Usage: 971e01aa904Sopenharmony_ci 972e01aa904Sopenharmony_ci ``soname_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 973e01aa904Sopenharmony_ci 974e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 975e01aa904Sopenharmony_ci shared library which SONAME property matches the regular expression 976e01aa904Sopenharmony_ci specified as value of this property. 977e01aa904Sopenharmony_ci 978e01aa904Sopenharmony_ci 979e01aa904Sopenharmony_ci* ``soname_not_regexp`` 980e01aa904Sopenharmony_ci 981e01aa904Sopenharmony_ci Usage: 982e01aa904Sopenharmony_ci 983e01aa904Sopenharmony_ci ``soname_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 984e01aa904Sopenharmony_ci 985e01aa904Sopenharmony_ci Suppresses change reports about ABI artifacts that are defined in a 986e01aa904Sopenharmony_ci shared library which SONAME property does not match the regular 987e01aa904Sopenharmony_ci expression specified as value of this property. 988e01aa904Sopenharmony_ci 989e01aa904Sopenharmony_ci 990e01aa904Sopenharmony_ci* ``name`` 991e01aa904Sopenharmony_ci 992e01aa904Sopenharmony_ci Usage: 993e01aa904Sopenharmony_ci 994e01aa904Sopenharmony_ci ``name`` ``=`` <some-value> 995e01aa904Sopenharmony_ci 996e01aa904Sopenharmony_ci Suppresses change reports involving variables whose name equals the 997e01aa904Sopenharmony_ci value of this property. 998e01aa904Sopenharmony_ci 999e01aa904Sopenharmony_ci* ``name_regexp`` 1000e01aa904Sopenharmony_ci 1001e01aa904Sopenharmony_ci Usage: 1002e01aa904Sopenharmony_ci 1003e01aa904Sopenharmony_ci ``name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 1004e01aa904Sopenharmony_ci 1005e01aa904Sopenharmony_ci Suppresses change reports involving variables whose name matches the 1006e01aa904Sopenharmony_ci regular expression specified as value of this property. 1007e01aa904Sopenharmony_ci 1008e01aa904Sopenharmony_ci* ``change_kind`` 1009e01aa904Sopenharmony_ci 1010e01aa904Sopenharmony_ci Usage: 1011e01aa904Sopenharmony_ci 1012e01aa904Sopenharmony_ci ``change_kind`` ``=`` <predefined-possible-values> 1013e01aa904Sopenharmony_ci 1014e01aa904Sopenharmony_ci Specifies the kind of changes this suppression specification should 1015e01aa904Sopenharmony_ci apply to. The possible values of this property as well as their 1016e01aa904Sopenharmony_ci meaning are the same as when it's :ref:`used in the 1017e01aa904Sopenharmony_ci [suppress_function] section <suppr_change_kind_property_label>`. 1018e01aa904Sopenharmony_ci 1019e01aa904Sopenharmony_ci* ``symbol_name`` 1020e01aa904Sopenharmony_ci 1021e01aa904Sopenharmony_ci Usage: 1022e01aa904Sopenharmony_ci 1023e01aa904Sopenharmony_ci ``symbol_name`` ``=`` <some-value> 1024e01aa904Sopenharmony_ci 1025e01aa904Sopenharmony_ci Suppresses change reports involving variables whose symbol name equals 1026e01aa904Sopenharmony_ci the value of this property. 1027e01aa904Sopenharmony_ci 1028e01aa904Sopenharmony_ci* symbol_name_regexp 1029e01aa904Sopenharmony_ci 1030e01aa904Sopenharmony_ci Usage: 1031e01aa904Sopenharmony_ci 1032e01aa904Sopenharmony_ci ``symbol_name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 1033e01aa904Sopenharmony_ci 1034e01aa904Sopenharmony_ci Suppresses change reports involving variables whose symbol name 1035e01aa904Sopenharmony_ci matches the regular expression specified as value of this property. 1036e01aa904Sopenharmony_ci 1037e01aa904Sopenharmony_ci 1038e01aa904Sopenharmony_ci* ``symbol_name_not_regexp`` 1039e01aa904Sopenharmony_ci 1040e01aa904Sopenharmony_ci Usage: 1041e01aa904Sopenharmony_ci 1042e01aa904Sopenharmony_ci ``symbol_name_not_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 1043e01aa904Sopenharmony_ci 1044e01aa904Sopenharmony_ci Suppresses change reports involving variables whose symbol name does 1045e01aa904Sopenharmony_ci not match the regular expression specified as value of this property. 1046e01aa904Sopenharmony_ci 1047e01aa904Sopenharmony_ci* ``symbol_version`` 1048e01aa904Sopenharmony_ci 1049e01aa904Sopenharmony_ci Usage: 1050e01aa904Sopenharmony_ci 1051e01aa904Sopenharmony_ci ``symbol_version`` ``=`` <some-value> 1052e01aa904Sopenharmony_ci 1053e01aa904Sopenharmony_ci Suppresses change reports involving variables whose symbol version 1054e01aa904Sopenharmony_ci equals the value of this property. 1055e01aa904Sopenharmony_ci 1056e01aa904Sopenharmony_ci* ``symbol_version_regexp`` 1057e01aa904Sopenharmony_ci 1058e01aa904Sopenharmony_ci Usage: 1059e01aa904Sopenharmony_ci 1060e01aa904Sopenharmony_ci ``symbol_version_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 1061e01aa904Sopenharmony_ci 1062e01aa904Sopenharmony_ci Suppresses change reports involving variables whose symbol version 1063e01aa904Sopenharmony_ci matches the regular expression specified as value of this property. 1064e01aa904Sopenharmony_ci 1065e01aa904Sopenharmony_ci* ``type_name`` 1066e01aa904Sopenharmony_ci 1067e01aa904Sopenharmony_ci Usage: 1068e01aa904Sopenharmony_ci 1069e01aa904Sopenharmony_ci ``type_name`` ``=`` <some-value> 1070e01aa904Sopenharmony_ci 1071e01aa904Sopenharmony_ci Suppresses change reports involving variables whose type name equals 1072e01aa904Sopenharmony_ci the value of this property. 1073e01aa904Sopenharmony_ci 1074e01aa904Sopenharmony_ci* ``type_name_regexp`` 1075e01aa904Sopenharmony_ci 1076e01aa904Sopenharmony_ci Usage: 1077e01aa904Sopenharmony_ci 1078e01aa904Sopenharmony_ci ``type_name_regexp`` ``=`` <:ref:`regular-expression <suppr_regexp_label>`> 1079e01aa904Sopenharmony_ci 1080e01aa904Sopenharmony_ci Suppresses change reports involving variables whose type name matches 1081e01aa904Sopenharmony_ci the regular expression specified as value of this property. 1082e01aa904Sopenharmony_ci 1083e01aa904Sopenharmony_ciComments 1084e01aa904Sopenharmony_ci^^^^^^^^ 1085e01aa904Sopenharmony_ci 1086e01aa904Sopenharmony_ci``;`` or ``#`` ASCII character at the beginning of a line 1087e01aa904Sopenharmony_ciindicates a comment. Comment lines are ignored. 1088e01aa904Sopenharmony_ci 1089e01aa904Sopenharmony_ciCode examples 1090e01aa904Sopenharmony_ci^^^^^^^^^^^^^ 1091e01aa904Sopenharmony_ci 1092e01aa904Sopenharmony_ci1. Suppressing change reports about types. 1093e01aa904Sopenharmony_ci 1094e01aa904Sopenharmony_ci Suppose we have a library named ``libtest1-v0.so`` which 1095e01aa904Sopenharmony_ci contains this very useful code: :: 1096e01aa904Sopenharmony_ci 1097e01aa904Sopenharmony_ci $ cat -n test1-v0.cc 1098e01aa904Sopenharmony_ci 1 // A forward declaration for a type considered to be opaque to 1099e01aa904Sopenharmony_ci 2 // function foo() below. 1100e01aa904Sopenharmony_ci 3 struct opaque_type; 1101e01aa904Sopenharmony_ci 4 1102e01aa904Sopenharmony_ci 5 // This function cannot touch any member of opaque_type. Hence, 1103e01aa904Sopenharmony_ci 6 // changes to members of opaque_type should not impact foo, as far as 1104e01aa904Sopenharmony_ci 7 // ABI is concerned. 1105e01aa904Sopenharmony_ci 8 void 1106e01aa904Sopenharmony_ci 9 foo(opaque_type*) 1107e01aa904Sopenharmony_ci 10 { 1108e01aa904Sopenharmony_ci 11 } 1109e01aa904Sopenharmony_ci 12 1110e01aa904Sopenharmony_ci 13 struct opaque_type 1111e01aa904Sopenharmony_ci 14 { 1112e01aa904Sopenharmony_ci 15 int member0; 1113e01aa904Sopenharmony_ci 16 char member1; 1114e01aa904Sopenharmony_ci 17 }; 1115e01aa904Sopenharmony_ci $ 1116e01aa904Sopenharmony_ci 1117e01aa904Sopenharmony_ciLet's change the layout of struct opaque_type by inserting a data 1118e01aa904Sopenharmony_cimember around line 15, leading to a new version of the library, 1119e01aa904Sopenharmony_cithat we shall name ``libtest1-v1.so``: :: 1120e01aa904Sopenharmony_ci 1121e01aa904Sopenharmony_ci $ cat -n test1-v1.cc 1122e01aa904Sopenharmony_ci 1 // A forward declaration for a type considered to be opaque to 1123e01aa904Sopenharmony_ci 2 // function foo() below. 1124e01aa904Sopenharmony_ci 3 struct opaque_type; 1125e01aa904Sopenharmony_ci 4 1126e01aa904Sopenharmony_ci 5 // This function cannot touch any member of opaque_type; Hence, 1127e01aa904Sopenharmony_ci 6 // changes to members of opaque_type should not impact foo, as far as 1128e01aa904Sopenharmony_ci 7 // ABI is concerned. 1129e01aa904Sopenharmony_ci 8 void 1130e01aa904Sopenharmony_ci 9 foo(opaque_type*) 1131e01aa904Sopenharmony_ci 10 { 1132e01aa904Sopenharmony_ci 11 } 1133e01aa904Sopenharmony_ci 12 1134e01aa904Sopenharmony_ci 13 struct opaque_type 1135e01aa904Sopenharmony_ci 14 { 1136e01aa904Sopenharmony_ci 15 char added_member; // <-- a new member got added here now. 1137e01aa904Sopenharmony_ci 16 int member0; 1138e01aa904Sopenharmony_ci 17 char member1; 1139e01aa904Sopenharmony_ci 18 }; 1140e01aa904Sopenharmony_ci $ 1141e01aa904Sopenharmony_ci 1142e01aa904Sopenharmony_ciLet's compile both examples. We shall not forget to compile them 1143e01aa904Sopenharmony_ciwith debug information generation turned on: :: 1144e01aa904Sopenharmony_ci 1145e01aa904Sopenharmony_ci $ g++ -shared -g -Wall -o libtest1-v0.so test1-v0.cc 1146e01aa904Sopenharmony_ci $ g++ -shared -g -Wall -o libtest1-v1.so test1-v1.cc 1147e01aa904Sopenharmony_ci 1148e01aa904Sopenharmony_ciLet's ask :ref:`abidiff <abidiff_label>` which ABI differences it sees 1149e01aa904Sopenharmony_cibetween ``libtest1-v0.so`` and ``libtest1-v1.so``: :: 1150e01aa904Sopenharmony_ci 1151e01aa904Sopenharmony_ci $ abidiff libtest1-v0.so libtest1-v1.so 1152e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 1 Changed, 0 Added function 1153e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1154e01aa904Sopenharmony_ci 1155e01aa904Sopenharmony_ci 1 function with some indirect sub-type change: 1156e01aa904Sopenharmony_ci 1157e01aa904Sopenharmony_ci [C]'function void foo(opaque_type*)' has some indirect sub-type changes: 1158e01aa904Sopenharmony_ci parameter 0 of type 'opaque_type*' has sub-type changes: 1159e01aa904Sopenharmony_ci in pointed to type 'struct opaque_type': 1160e01aa904Sopenharmony_ci size changed from 64 to 96 bits 1161e01aa904Sopenharmony_ci 1 data member insertion: 1162e01aa904Sopenharmony_ci 'char opaque_type::added_member', at offset 0 (in bits) 1163e01aa904Sopenharmony_ci 2 data member changes: 1164e01aa904Sopenharmony_ci 'int opaque_type::member0' offset changed from 0 to 32 1165e01aa904Sopenharmony_ci 'char opaque_type::member1' offset changed from 32 to 64 1166e01aa904Sopenharmony_ci 1167e01aa904Sopenharmony_ci 1168e01aa904Sopenharmony_ciSo ``abidiff`` reports that the opaque_type's layout has changed 1169e01aa904Sopenharmony_ciin a significant way, as far as ABI implications are concerned, in 1170e01aa904Sopenharmony_citheory. After all, a sub-type (``struct opaque_type``) of an 1171e01aa904Sopenharmony_ciexported function (``foo()``) has seen its layout change. This 1172e01aa904Sopenharmony_cimight have non negligible ABI implications. But in practice here, 1173e01aa904Sopenharmony_cithe programmer of the litest1-v1.so library knows that the "soft" 1174e01aa904Sopenharmony_cicontract between the function ``foo()`` and the type ``struct 1175e01aa904Sopenharmony_ciopaque_type`` is to stay away from the data members of the type. 1176e01aa904Sopenharmony_ciSo layout changes of ``struct opaque_type`` should not impact 1177e01aa904Sopenharmony_ci``foo()``. 1178e01aa904Sopenharmony_ci 1179e01aa904Sopenharmony_ciNow to teach ``abidiff`` about this soft contract and have it 1180e01aa904Sopenharmony_ciavoid emitting what amounts to false positives in this case, we 1181e01aa904Sopenharmony_ciwrite the suppression specification file below: :: 1182e01aa904Sopenharmony_ci 1183e01aa904Sopenharmony_ci $ cat test1.suppr 1184e01aa904Sopenharmony_ci [suppress_type] 1185e01aa904Sopenharmony_ci type_kind = struct 1186e01aa904Sopenharmony_ci name = opaque_type 1187e01aa904Sopenharmony_ci 1188e01aa904Sopenharmony_ciTranslated in plain English, this suppression specification would 1189e01aa904Sopenharmony_ciread: "Do not emit change reports about a struct which name is 1190e01aa904Sopenharmony_ciopaque_type". 1191e01aa904Sopenharmony_ci 1192e01aa904Sopenharmony_ciLet's now invoke ``abidiff`` on the two versions of the library 1193e01aa904Sopenharmony_ciagain, but this time with the suppression specification: :: 1194e01aa904Sopenharmony_ci 1195e01aa904Sopenharmony_ci $ abidiff --suppressions test1.suppr libtest1-v0.so libtest1-v1.so 1196e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function 1197e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1198e01aa904Sopenharmony_ci 1199e01aa904Sopenharmony_ciAs you can see, ``abidiff`` does not report the change anymore; it 1200e01aa904Sopenharmony_citells us that it was filtered out instead. 1201e01aa904Sopenharmony_ci 1202e01aa904Sopenharmony_ciSuppressing change reports about types with data member 1203e01aa904Sopenharmony_ciinsertions 1204e01aa904Sopenharmony_ci 1205e01aa904Sopenharmony_ciSuppose the first version of a library named ``libtest3-v0.so`` 1206e01aa904Sopenharmony_cihas this source code: :: 1207e01aa904Sopenharmony_ci 1208e01aa904Sopenharmony_ci /* Compile this with: 1209e01aa904Sopenharmony_ci gcc -g -Wall -shared -o libtest3-v0.so test3-v0.c 1210e01aa904Sopenharmony_ci */ 1211e01aa904Sopenharmony_ci 1212e01aa904Sopenharmony_ci struct S 1213e01aa904Sopenharmony_ci { 1214e01aa904Sopenharmony_ci char member0; 1215e01aa904Sopenharmony_ci int member1; /* 1216e01aa904Sopenharmony_ci between member1 and member2, there is some padding, 1217e01aa904Sopenharmony_ci at least on some popular platforms. On 1218e01aa904Sopenharmony_ci these platforms, adding a small enough data 1219e01aa904Sopenharmony_ci member into that padding shouldn't change 1220e01aa904Sopenharmony_ci the offset of member1. Right? 1221e01aa904Sopenharmony_ci */ 1222e01aa904Sopenharmony_ci }; 1223e01aa904Sopenharmony_ci 1224e01aa904Sopenharmony_ci int 1225e01aa904Sopenharmony_ci foo(struct S* s) 1226e01aa904Sopenharmony_ci { 1227e01aa904Sopenharmony_ci return s->member0 + s->member1; 1228e01aa904Sopenharmony_ci } 1229e01aa904Sopenharmony_ci 1230e01aa904Sopenharmony_ciNow, suppose the second version of the library named 1231e01aa904Sopenharmony_ci``libtest3-v1.so`` has this source code in which a data member 1232e01aa904Sopenharmony_cihas been added in the padding space of struct S and another data 1233e01aa904Sopenharmony_cimember has been added at its end: :: 1234e01aa904Sopenharmony_ci 1235e01aa904Sopenharmony_ci /* Compile this with: 1236e01aa904Sopenharmony_ci gcc -g -Wall -shared -o libtest3-v1.so test3-v1.c 1237e01aa904Sopenharmony_ci */ 1238e01aa904Sopenharmony_ci 1239e01aa904Sopenharmony_ci struct S 1240e01aa904Sopenharmony_ci { 1241e01aa904Sopenharmony_ci char member0; 1242e01aa904Sopenharmony_ci char inserted1; /* <---- A data member has been added here... */ 1243e01aa904Sopenharmony_ci int member1; 1244e01aa904Sopenharmony_ci char inserted2; /* <---- ... and another one has been added here. */ 1245e01aa904Sopenharmony_ci }; 1246e01aa904Sopenharmony_ci 1247e01aa904Sopenharmony_ci int 1248e01aa904Sopenharmony_ci foo(struct S* s) 1249e01aa904Sopenharmony_ci { 1250e01aa904Sopenharmony_ci return s->member0 + s->member1; 1251e01aa904Sopenharmony_ci } 1252e01aa904Sopenharmony_ci 1253e01aa904Sopenharmony_ci 1254e01aa904Sopenharmony_ciIn libtest3-v1.so, adding char data members ``S::inserted1`` and 1255e01aa904Sopenharmony_ci``S::inserted2`` can be considered harmless (from an ABI compatibility 1256e01aa904Sopenharmony_ciperspective), at least on the x86 platform, because that doesn't 1257e01aa904Sopenharmony_cichange the offsets of the data members S::member0 and S::member1. But 1258e01aa904Sopenharmony_cithen running ``abidiff`` on these two versions of library yields: :: 1259e01aa904Sopenharmony_ci 1260e01aa904Sopenharmony_ci $ abidiff libtest3-v0.so libtest3-v1.so 1261e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 1 Changed, 0 Added function 1262e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1263e01aa904Sopenharmony_ci 1264e01aa904Sopenharmony_ci 1 function with some indirect sub-type change: 1265e01aa904Sopenharmony_ci 1266e01aa904Sopenharmony_ci [C]'function int foo(S*)' has some indirect sub-type changes: 1267e01aa904Sopenharmony_ci parameter 0 of type 'S*' has sub-type changes: 1268e01aa904Sopenharmony_ci in pointed to type 'struct S': 1269e01aa904Sopenharmony_ci type size changed from 64 to 96 bits 1270e01aa904Sopenharmony_ci 2 data member insertions: 1271e01aa904Sopenharmony_ci 'char S::inserted1', at offset 8 (in bits) 1272e01aa904Sopenharmony_ci 'char S::inserted2', at offset 64 (in bits) 1273e01aa904Sopenharmony_ci $ 1274e01aa904Sopenharmony_ci 1275e01aa904Sopenharmony_ci 1276e01aa904Sopenharmony_ci 1277e01aa904Sopenharmony_ciThat is, ``abidiff`` shows us the two changes, even though we (the 1278e01aa904Sopenharmony_cidevelopers of that very involved library) know that these changes 1279e01aa904Sopenharmony_ciare harmless in this particular context. 1280e01aa904Sopenharmony_ci 1281e01aa904Sopenharmony_ciLuckily, we can devise a suppression specification that essentially 1282e01aa904Sopenharmony_citells abidiff to filter out change reports about adding a data 1283e01aa904Sopenharmony_cimember between ``S::member0`` and ``S::member1``, and adding a data 1284e01aa904Sopenharmony_cimember at the end of struct S. We have written such a suppression 1285e01aa904Sopenharmony_cispecification in a file called test3-1.suppr and it unsurprisingly 1286e01aa904Sopenharmony_cilooks like: :: 1287e01aa904Sopenharmony_ci 1288e01aa904Sopenharmony_ci [suppress_type] 1289e01aa904Sopenharmony_ci name = S 1290e01aa904Sopenharmony_ci has_data_member_inserted_between = {offset_after(member0), offset_of(member1)} 1291e01aa904Sopenharmony_ci has_data_member_inserted_at = end 1292e01aa904Sopenharmony_ci 1293e01aa904Sopenharmony_ci 1294e01aa904Sopenharmony_ciNow running ``abidiff`` with this suppression specification yields: :: 1295e01aa904Sopenharmony_ci 1296e01aa904Sopenharmony_ci $ ../build/tools/abidiff --suppressions test3-1.suppr libtest3-v0.so libtest3-v1.so 1297e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function 1298e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1299e01aa904Sopenharmony_ci 1300e01aa904Sopenharmony_ci $ 1301e01aa904Sopenharmony_ci 1302e01aa904Sopenharmony_ci 1303e01aa904Sopenharmony_ciHooora! \\o/ (I guess) 1304e01aa904Sopenharmony_ci 1305e01aa904Sopenharmony_ci.. _example_accessed_through_label: 1306e01aa904Sopenharmony_ci 1307e01aa904Sopenharmony_ciSuppressing change reports about types accessed either directly 1308e01aa904Sopenharmony_cior through pointers 1309e01aa904Sopenharmony_ci 1310e01aa904Sopenharmony_ciSuppose we have a first version of an object file which source 1311e01aa904Sopenharmony_cicode is the file widget-v0.cc below: :: 1312e01aa904Sopenharmony_ci 1313e01aa904Sopenharmony_ci // Compile with: g++ -g -c widget-v0.cc 1314e01aa904Sopenharmony_ci 1315e01aa904Sopenharmony_ci struct widget 1316e01aa904Sopenharmony_ci { 1317e01aa904Sopenharmony_ci int x; 1318e01aa904Sopenharmony_ci int y; 1319e01aa904Sopenharmony_ci 1320e01aa904Sopenharmony_ci widget() 1321e01aa904Sopenharmony_ci :x(), y() 1322e01aa904Sopenharmony_ci {} 1323e01aa904Sopenharmony_ci }; 1324e01aa904Sopenharmony_ci 1325e01aa904Sopenharmony_ci void 1326e01aa904Sopenharmony_ci fun0(widget*) 1327e01aa904Sopenharmony_ci { 1328e01aa904Sopenharmony_ci // .. do stuff here. 1329e01aa904Sopenharmony_ci } 1330e01aa904Sopenharmony_ci 1331e01aa904Sopenharmony_ci void 1332e01aa904Sopenharmony_ci fun1(widget&) 1333e01aa904Sopenharmony_ci { 1334e01aa904Sopenharmony_ci // .. do stuff here .. 1335e01aa904Sopenharmony_ci } 1336e01aa904Sopenharmony_ci 1337e01aa904Sopenharmony_ci void 1338e01aa904Sopenharmony_ci fun2(widget w) 1339e01aa904Sopenharmony_ci { 1340e01aa904Sopenharmony_ci // ... do other stuff here ... 1341e01aa904Sopenharmony_ci } 1342e01aa904Sopenharmony_ci 1343e01aa904Sopenharmony_ciNow suppose in the second version of that file, named 1344e01aa904Sopenharmony_ciwidget-v1.cc, we have added some data members at the end of 1345e01aa904Sopenharmony_cithe type ``struct widget``; here is what the content of that file 1346e01aa904Sopenharmony_ciwould look like: :: 1347e01aa904Sopenharmony_ci 1348e01aa904Sopenharmony_ci // Compile with: g++ -g -c widget-v1.cc 1349e01aa904Sopenharmony_ci 1350e01aa904Sopenharmony_ci struct widget 1351e01aa904Sopenharmony_ci { 1352e01aa904Sopenharmony_ci int x; 1353e01aa904Sopenharmony_ci int y; 1354e01aa904Sopenharmony_ci int w; // We have added these two new data members here .. 1355e01aa904Sopenharmony_ci int h; // ... and here. 1356e01aa904Sopenharmony_ci 1357e01aa904Sopenharmony_ci widget() 1358e01aa904Sopenharmony_ci : x(), y(), w(), h() 1359e01aa904Sopenharmony_ci {} 1360e01aa904Sopenharmony_ci }; 1361e01aa904Sopenharmony_ci 1362e01aa904Sopenharmony_ci void 1363e01aa904Sopenharmony_ci fun0(widget*) 1364e01aa904Sopenharmony_ci { 1365e01aa904Sopenharmony_ci // .. do stuff here. 1366e01aa904Sopenharmony_ci } 1367e01aa904Sopenharmony_ci 1368e01aa904Sopenharmony_ci void 1369e01aa904Sopenharmony_ci fun1(widget&) 1370e01aa904Sopenharmony_ci { 1371e01aa904Sopenharmony_ci // .. do stuff here .. 1372e01aa904Sopenharmony_ci } 1373e01aa904Sopenharmony_ci 1374e01aa904Sopenharmony_ci void 1375e01aa904Sopenharmony_ci fun2(widget w) 1376e01aa904Sopenharmony_ci { 1377e01aa904Sopenharmony_ci // ... do other stuff here ... 1378e01aa904Sopenharmony_ci } 1379e01aa904Sopenharmony_ci 1380e01aa904Sopenharmony_ciWhen we invoke ``abidiff`` on the object files resulting from the 1381e01aa904Sopenharmony_cicompilation of the two file above, here is what we get: :: 1382e01aa904Sopenharmony_ci 1383e01aa904Sopenharmony_ci $ abidiff widget-v0.o widget-v1.o 1384e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 2 Changed (1 filtered out), 0 Added functions 1385e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1386e01aa904Sopenharmony_ci 1387e01aa904Sopenharmony_ci 2 functions with some indirect sub-type change: 1388e01aa904Sopenharmony_ci 1389e01aa904Sopenharmony_ci [C]'function void fun0(widget*)' has some indirect sub-type changes: 1390e01aa904Sopenharmony_ci parameter 1 of type 'widget*' has sub-type changes: 1391e01aa904Sopenharmony_ci in pointed to type 'struct widget': 1392e01aa904Sopenharmony_ci type size changed from 64 to 128 bits 1393e01aa904Sopenharmony_ci 2 data member insertions: 1394e01aa904Sopenharmony_ci 'int widget::w', at offset 64 (in bits) 1395e01aa904Sopenharmony_ci 'int widget::h', at offset 96 (in bits) 1396e01aa904Sopenharmony_ci 1397e01aa904Sopenharmony_ci [C]'function void fun2(widget)' has some indirect sub-type changes: 1398e01aa904Sopenharmony_ci parameter 1 of type 'struct widget' has sub-type changes: 1399e01aa904Sopenharmony_ci details were reported earlier 1400e01aa904Sopenharmony_ci $ 1401e01aa904Sopenharmony_ci 1402e01aa904Sopenharmony_ciI guess a little bit of explaining is due here. ``abidiff`` 1403e01aa904Sopenharmony_cidetects that two data member got added at the end of ``struct 1404e01aa904Sopenharmony_ciwidget``. it also tells us that the type change impacts the 1405e01aa904Sopenharmony_ciexported function ``fun0()`` which uses the type ``struct 1406e01aa904Sopenharmony_ciwidget`` through a pointer, in its signature. 1407e01aa904Sopenharmony_ci 1408e01aa904Sopenharmony_ciCareful readers will notice that the change to ``struct widget`` 1409e01aa904Sopenharmony_cialso impacts the exported function ``fun1()``, that uses type 1410e01aa904Sopenharmony_ci``struct widget`` through a reference. But then ``abidiff`` 1411e01aa904Sopenharmony_cidoesn't tell us about the impact on that function ``fun1()`` 1412e01aa904Sopenharmony_cibecause it has evaluated that change as being **redundant** with 1413e01aa904Sopenharmony_cithe change it reported on ``fun0()``. It has thus filtered it 1414e01aa904Sopenharmony_ciout, to avoid cluttering the output with noise. 1415e01aa904Sopenharmony_ci 1416e01aa904Sopenharmony_ciRedundancy detection and filtering is fine and helpful to avoid 1417e01aa904Sopenharmony_ciburying the important information in a sea of noise. However, it 1418e01aa904Sopenharmony_cimust be treated with care, by fear of mistakenly filtering out 1419e01aa904Sopenharmony_cirelevant and important information. 1420e01aa904Sopenharmony_ci 1421e01aa904Sopenharmony_ciThat is why ``abidiff`` tells us about the impact that the change 1422e01aa904Sopenharmony_cito ``struct widget`` has on function ``fun2()``. In this case, 1423e01aa904Sopenharmony_cithat function uses the type ``struct widget`` **directly** (in 1424e01aa904Sopenharmony_ciits signature). It does not use it via a pointer or a reference. 1425e01aa904Sopenharmony_ciIn this case, the direct use of this type causes ``fun2()`` to be 1426e01aa904Sopenharmony_ciexposed to a potentially harmful ABI change. Hence, the report 1427e01aa904Sopenharmony_ciabout ``fun2()`` is not filtered out, even though it's about that 1428e01aa904Sopenharmony_cisame change on ``struct widget``. 1429e01aa904Sopenharmony_ci 1430e01aa904Sopenharmony_ciTo go further in suppressing reports about changes that are 1431e01aa904Sopenharmony_ciharmless and keeping only those that we know are harmful, we 1432e01aa904Sopenharmony_ciwould like to go tell abidiff to suppress reports about this 1433e01aa904Sopenharmony_ciparticular ``struct widget`` change when it impacts uses of 1434e01aa904Sopenharmony_ci``struct widget`` through a pointer or reference. In other 1435e01aa904Sopenharmony_ciwords, suppress the change reports about ``fun0()`` **and** 1436e01aa904Sopenharmony_ci``fun1()``. We would then write this suppression specification, 1437e01aa904Sopenharmony_ciin file ``widget.suppr``: :: 1438e01aa904Sopenharmony_ci 1439e01aa904Sopenharmony_ci [suppress_type] 1440e01aa904Sopenharmony_ci name = widget 1441e01aa904Sopenharmony_ci type_kind = struct 1442e01aa904Sopenharmony_ci has_data_member_inserted_at = end 1443e01aa904Sopenharmony_ci accessed_through = reference-or-pointer 1444e01aa904Sopenharmony_ci 1445e01aa904Sopenharmony_ci # So this suppression specification says to suppress reports about 1446e01aa904Sopenharmony_ci # the type 'struct widget', if this type was added some data member 1447e01aa904Sopenharmony_ci # at its end, and if the change impacts uses of the type through a 1448e01aa904Sopenharmony_ci # reference or a pointer. 1449e01aa904Sopenharmony_ci 1450e01aa904Sopenharmony_ciInvoking ``abidiff`` on ``widget-v0.o`` and ``widget-v1.o`` with 1451e01aa904Sopenharmony_cithis suppression specification yields: :: 1452e01aa904Sopenharmony_ci 1453e01aa904Sopenharmony_ci $ abidiff --suppressions widget.suppr widget-v0.o widget-v1.o 1454e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 1 Changed (2 filtered out), 0 Added function 1455e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1456e01aa904Sopenharmony_ci 1457e01aa904Sopenharmony_ci 1 function with some indirect sub-type change: 1458e01aa904Sopenharmony_ci 1459e01aa904Sopenharmony_ci [C]'function void fun2(widget)' has some indirect sub-type changes: 1460e01aa904Sopenharmony_ci parameter 1 of type 'struct widget' has sub-type changes: 1461e01aa904Sopenharmony_ci type size changed from 64 to 128 bits 1462e01aa904Sopenharmony_ci 2 data member insertions: 1463e01aa904Sopenharmony_ci 'int widget::w', at offset 64 (in bits) 1464e01aa904Sopenharmony_ci 'int widget::h', at offset 96 (in bits) 1465e01aa904Sopenharmony_ci $ 1466e01aa904Sopenharmony_ci 1467e01aa904Sopenharmony_ciAs expected, I guess. 1468e01aa904Sopenharmony_ci 1469e01aa904Sopenharmony_ciSuppressing change reports about functions. 1470e01aa904Sopenharmony_ci 1471e01aa904Sopenharmony_ciSuppose we have a first version a library named 1472e01aa904Sopenharmony_ci``libtest2-v0.so`` whose source code is: :: 1473e01aa904Sopenharmony_ci 1474e01aa904Sopenharmony_ci $ cat -n test2-v0.cc 1475e01aa904Sopenharmony_ci 1476e01aa904Sopenharmony_ci 1 struct S1 1477e01aa904Sopenharmony_ci 2 { 1478e01aa904Sopenharmony_ci 3 int m0; 1479e01aa904Sopenharmony_ci 4 1480e01aa904Sopenharmony_ci 5 S1() 1481e01aa904Sopenharmony_ci 6 : m0() 1482e01aa904Sopenharmony_ci 7 {} 1483e01aa904Sopenharmony_ci 8 }; 1484e01aa904Sopenharmony_ci 9 1485e01aa904Sopenharmony_ci 10 struct S2 1486e01aa904Sopenharmony_ci 11 { 1487e01aa904Sopenharmony_ci 12 int m0; 1488e01aa904Sopenharmony_ci 13 1489e01aa904Sopenharmony_ci 14 S2() 1490e01aa904Sopenharmony_ci 15 : m0() 1491e01aa904Sopenharmony_ci 16 {} 1492e01aa904Sopenharmony_ci 17 }; 1493e01aa904Sopenharmony_ci 18 1494e01aa904Sopenharmony_ci 19 struct S3 1495e01aa904Sopenharmony_ci 20 { 1496e01aa904Sopenharmony_ci 21 int m0; 1497e01aa904Sopenharmony_ci 22 1498e01aa904Sopenharmony_ci 23 S3() 1499e01aa904Sopenharmony_ci 24 : m0() 1500e01aa904Sopenharmony_ci 25 {} 1501e01aa904Sopenharmony_ci 26 }; 1502e01aa904Sopenharmony_ci 27 1503e01aa904Sopenharmony_ci 28 int 1504e01aa904Sopenharmony_ci 29 func(S1&) 1505e01aa904Sopenharmony_ci 30 { 1506e01aa904Sopenharmony_ci 31 // suppose the code does something with the argument. 1507e01aa904Sopenharmony_ci 32 return 0; 1508e01aa904Sopenharmony_ci 33 1509e01aa904Sopenharmony_ci 34 } 1510e01aa904Sopenharmony_ci 35 1511e01aa904Sopenharmony_ci 36 char 1512e01aa904Sopenharmony_ci 37 func(S2*) 1513e01aa904Sopenharmony_ci 38 { 1514e01aa904Sopenharmony_ci 39 // suppose the code does something with the argument. 1515e01aa904Sopenharmony_ci 40 return 0; 1516e01aa904Sopenharmony_ci 41 } 1517e01aa904Sopenharmony_ci 42 1518e01aa904Sopenharmony_ci 43 unsigned 1519e01aa904Sopenharmony_ci 44 func(S3) 1520e01aa904Sopenharmony_ci 45 { 1521e01aa904Sopenharmony_ci 46 // suppose the code does something with the argument. 1522e01aa904Sopenharmony_ci 47 return 0; 1523e01aa904Sopenharmony_ci 48 } 1524e01aa904Sopenharmony_ci $ 1525e01aa904Sopenharmony_ci 1526e01aa904Sopenharmony_ciAnd then we come up with a second version ``libtest2-v1.so`` of 1527e01aa904Sopenharmony_cithat library; the source code is modified by making the 1528e01aa904Sopenharmony_cistructures ``S1``, ``S2``, ``S3`` inherit another struct: :: 1529e01aa904Sopenharmony_ci 1530e01aa904Sopenharmony_ci $ cat -n test2-v1.cc 1531e01aa904Sopenharmony_ci 1 struct base_type 1532e01aa904Sopenharmony_ci 2 { 1533e01aa904Sopenharmony_ci 3 int m_inserted; 1534e01aa904Sopenharmony_ci 4 }; 1535e01aa904Sopenharmony_ci 5 1536e01aa904Sopenharmony_ci 6 struct S1 : public base_type // <--- S1 now has base_type as its base 1537e01aa904Sopenharmony_ci 7 // type. 1538e01aa904Sopenharmony_ci 8 { 1539e01aa904Sopenharmony_ci 9 int m0; 1540e01aa904Sopenharmony_ci 10 1541e01aa904Sopenharmony_ci 11 S1() 1542e01aa904Sopenharmony_ci 12 : m0() 1543e01aa904Sopenharmony_ci 13 {} 1544e01aa904Sopenharmony_ci 14 }; 1545e01aa904Sopenharmony_ci 15 1546e01aa904Sopenharmony_ci 16 struct S2 : public base_type // <--- S2 now has base_type as its base 1547e01aa904Sopenharmony_ci 17 // type. 1548e01aa904Sopenharmony_ci 18 { 1549e01aa904Sopenharmony_ci 19 int m0; 1550e01aa904Sopenharmony_ci 20 1551e01aa904Sopenharmony_ci 21 S2() 1552e01aa904Sopenharmony_ci 22 : m0() 1553e01aa904Sopenharmony_ci 23 {} 1554e01aa904Sopenharmony_ci 24 }; 1555e01aa904Sopenharmony_ci 25 1556e01aa904Sopenharmony_ci 26 struct S3 : public base_type // <--- S3 now has base_type as its base 1557e01aa904Sopenharmony_ci 27 // type. 1558e01aa904Sopenharmony_ci 28 { 1559e01aa904Sopenharmony_ci 29 int m0; 1560e01aa904Sopenharmony_ci 30 1561e01aa904Sopenharmony_ci 31 S3() 1562e01aa904Sopenharmony_ci 32 : m0() 1563e01aa904Sopenharmony_ci 33 {} 1564e01aa904Sopenharmony_ci 34 }; 1565e01aa904Sopenharmony_ci 35 1566e01aa904Sopenharmony_ci 36 int 1567e01aa904Sopenharmony_ci 37 func(S1&) 1568e01aa904Sopenharmony_ci 38 { 1569e01aa904Sopenharmony_ci 39 // suppose the code does something with the argument. 1570e01aa904Sopenharmony_ci 40 return 0; 1571e01aa904Sopenharmony_ci 41 1572e01aa904Sopenharmony_ci 42 } 1573e01aa904Sopenharmony_ci 43 1574e01aa904Sopenharmony_ci 44 char 1575e01aa904Sopenharmony_ci 45 func(S2*) 1576e01aa904Sopenharmony_ci 46 { 1577e01aa904Sopenharmony_ci 47 // suppose the code does something with the argument. 1578e01aa904Sopenharmony_ci 48 return 0; 1579e01aa904Sopenharmony_ci 49 } 1580e01aa904Sopenharmony_ci 50 1581e01aa904Sopenharmony_ci 51 unsigned 1582e01aa904Sopenharmony_ci 52 func(S3) 1583e01aa904Sopenharmony_ci 53 { 1584e01aa904Sopenharmony_ci 54 // suppose the code does something with the argument. 1585e01aa904Sopenharmony_ci 55 return 0; 1586e01aa904Sopenharmony_ci 56 } 1587e01aa904Sopenharmony_ci $ 1588e01aa904Sopenharmony_ci 1589e01aa904Sopenharmony_ciNow let's build the two libraries: :: 1590e01aa904Sopenharmony_ci 1591e01aa904Sopenharmony_ci g++ -Wall -g -shared -o libtest2-v0.so test2-v0.cc 1592e01aa904Sopenharmony_ci g++ -Wall -g -shared -o libtest2-v0.so test2-v0.cc 1593e01aa904Sopenharmony_ci 1594e01aa904Sopenharmony_ciLet's look at the output of ``abidiff``: :: 1595e01aa904Sopenharmony_ci 1596e01aa904Sopenharmony_ci $ abidiff libtest2-v0.so libtest2-v1.so 1597e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 3 Changed, 0 Added functions 1598e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1599e01aa904Sopenharmony_ci 1600e01aa904Sopenharmony_ci 3 functions with some indirect sub-type change: 1601e01aa904Sopenharmony_ci 1602e01aa904Sopenharmony_ci [C]'function unsigned int func(S3)' has some indirect sub-type changes: 1603e01aa904Sopenharmony_ci parameter 0 of type 'struct S3' has sub-type changes: 1604e01aa904Sopenharmony_ci size changed from 32 to 64 bits 1605e01aa904Sopenharmony_ci 1 base class insertion: 1606e01aa904Sopenharmony_ci struct base_type 1607e01aa904Sopenharmony_ci 1 data member change: 1608e01aa904Sopenharmony_ci 'int S3::m0' offset changed from 0 to 32 1609e01aa904Sopenharmony_ci 1610e01aa904Sopenharmony_ci [C]'function char func(S2*)' has some indirect sub-type changes: 1611e01aa904Sopenharmony_ci parameter 0 of type 'S2*' has sub-type changes: 1612e01aa904Sopenharmony_ci in pointed to type 'struct S2': 1613e01aa904Sopenharmony_ci size changed from 32 to 64 bits 1614e01aa904Sopenharmony_ci 1 base class insertion: 1615e01aa904Sopenharmony_ci struct base_type 1616e01aa904Sopenharmony_ci 1 data member change: 1617e01aa904Sopenharmony_ci 'int S2::m0' offset changed from 0 to 32 1618e01aa904Sopenharmony_ci 1619e01aa904Sopenharmony_ci [C]'function int func(S1&)' has some indirect sub-type changes: 1620e01aa904Sopenharmony_ci parameter 0 of type 'S1&' has sub-type changes: 1621e01aa904Sopenharmony_ci in referenced type 'struct S1': 1622e01aa904Sopenharmony_ci size changed from 32 to 64 bits 1623e01aa904Sopenharmony_ci 1 base class insertion: 1624e01aa904Sopenharmony_ci struct base_type 1625e01aa904Sopenharmony_ci 1 data member change: 1626e01aa904Sopenharmony_ci 'int S1::m0' offset changed from 0 to 32 1627e01aa904Sopenharmony_ci $ 1628e01aa904Sopenharmony_ci 1629e01aa904Sopenharmony_ciLet's tell ``abidiff`` to avoid showing us the differences on the 1630e01aa904Sopenharmony_cioverloads of ``func`` that takes either a pointer or a reference. 1631e01aa904Sopenharmony_ciFor that, we author this simple suppression specification: :: 1632e01aa904Sopenharmony_ci 1633e01aa904Sopenharmony_ci $ cat -n libtest2.suppr 1634e01aa904Sopenharmony_ci 1 [suppress_function] 1635e01aa904Sopenharmony_ci 2 name = func 1636e01aa904Sopenharmony_ci 3 parameter = '0 S1& 1637e01aa904Sopenharmony_ci 4 1638e01aa904Sopenharmony_ci 5 [suppress_function] 1639e01aa904Sopenharmony_ci 6 name = func 1640e01aa904Sopenharmony_ci 7 parameter = '0 S2* 1641e01aa904Sopenharmony_ci $ 1642e01aa904Sopenharmony_ci 1643e01aa904Sopenharmony_ciAnd then let's invoke ``abidiff`` with the suppression 1644e01aa904Sopenharmony_cispecification: :: 1645e01aa904Sopenharmony_ci 1646e01aa904Sopenharmony_ci $ ../build/tools/abidiff --suppressions libtest2.suppr libtest2-v0.so libtest2-v1.so 1647e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 1 Changed (2 filtered out), 0 Added function 1648e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1649e01aa904Sopenharmony_ci 1650e01aa904Sopenharmony_ci 1 function with some indirect sub-type change: 1651e01aa904Sopenharmony_ci 1652e01aa904Sopenharmony_ci [C]'function unsigned int func(S3)' has some indirect sub-type changes: 1653e01aa904Sopenharmony_ci parameter 0 of type 'struct S3' has sub-type changes: 1654e01aa904Sopenharmony_ci size changed from 32 to 64 bits 1655e01aa904Sopenharmony_ci 1 base class insertion: 1656e01aa904Sopenharmony_ci struct base_type 1657e01aa904Sopenharmony_ci 1 data member change: 1658e01aa904Sopenharmony_ci 'int S3::m0' offset changed from 0 to 32 1659e01aa904Sopenharmony_ci 1660e01aa904Sopenharmony_ci 1661e01aa904Sopenharmony_ciThe suppression specification could be reduced using 1662e01aa904Sopenharmony_ci:ref:`regular expressions <suppr_regexp_label>`: :: 1663e01aa904Sopenharmony_ci 1664e01aa904Sopenharmony_ci $ cat -n libtest2-1.suppr 1665e01aa904Sopenharmony_ci 1 [suppress_function] 1666e01aa904Sopenharmony_ci 2 name = func 1667e01aa904Sopenharmony_ci 3 parameter = '0 /^S.(&|\\*)/ 1668e01aa904Sopenharmony_ci $ 1669e01aa904Sopenharmony_ci 1670e01aa904Sopenharmony_ci $ ../build/tools/abidiff --suppressions libtest2-1.suppr libtest2-v0.so libtest2-v1.so 1671e01aa904Sopenharmony_ci Functions changes summary: 0 Removed, 1 Changed (2 filtered out), 0 Added function 1672e01aa904Sopenharmony_ci Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1673e01aa904Sopenharmony_ci 1674e01aa904Sopenharmony_ci 1 function with some indirect sub-type change: 1675e01aa904Sopenharmony_ci 1676e01aa904Sopenharmony_ci [C]'function unsigned int func(S3)' has some indirect sub-type changes: 1677e01aa904Sopenharmony_ci parameter 0 of type 'struct S3' has sub-type changes: 1678e01aa904Sopenharmony_ci size changed from 32 to 64 bits 1679e01aa904Sopenharmony_ci 1 base class insertion: 1680e01aa904Sopenharmony_ci struct base_type 1681e01aa904Sopenharmony_ci 1 data member change: 1682e01aa904Sopenharmony_ci 'int S3::m0' offset changed from 0 to 32 1683e01aa904Sopenharmony_ci 1684e01aa904Sopenharmony_ci $ 1685e01aa904Sopenharmony_ci 1686e01aa904Sopenharmony_ci.. _ELF: http://en.wikipedia.org/wiki/Executable_and_Linkable_Format 1687e01aa904Sopenharmony_ci 1688e01aa904Sopenharmony_ci.. _Ini File Syntax: http://en.wikipedia.org/wiki/INI_file 1689e01aa904Sopenharmony_ci 1690e01aa904Sopenharmony_ci.. _GNU C Library: http://www.gnu.org/software/libc 1691