Skip to content

Commit 027491d

Browse files
author
Sandra Loosemore
committed
Doc: Document -Wpsabi [PR81831]
Per the issue, there were a couple places in the manual where -Wno-psabi was mentioned, but the option itself was not documented. gcc/c-family/ChangeLog PR c/81831 * c.opt (Wpsabi): Remove "Undocumented" modifier and add a documentation string. gcc/ChangeLog PR c/81831 * doc/invoke.texi (Option Summary): Add -Wno-psabi. (Warning Options): Document -Wpsabi separately from -Wabi. Note it's enabled by default, not just implied by -Wabi. Replace the detailed example for a GCC 4.4 change for x86 (which is unlikely to be very interesting nowadays) with just a list of all targets that presently diagnose these warnings. (RS/6000 and PowerPC Options): Add cross-references for -Wno-psabi.
1 parent bbecb88 commit 027491d

File tree

2 files changed

+26
-28
lines changed

2 files changed

+26
-28
lines changed

gcc/c-family/c.opt

+2-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ C++ ObjC++ Var(warn_abi_tag) Warning
303303
Warn if a subobject has an abi_tag attribute that the complete object type does not have.
304304

305305
Wpsabi
306-
C ObjC C++ ObjC++ LTO Var(warn_psabi) Init(1) Warning Undocumented LangEnabledBy(C ObjC C++ ObjC++,Wabi)
306+
C ObjC C++ ObjC++ LTO Var(warn_psabi) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wabi)
307+
Warn about code affected by incompatible psABI changes.
307308

308309
Wabsolute-value
309310
C ObjC Var(warn_absolute_value) Warning EnabledBy(Wextra)

gcc/doc/invoke.texi

+24-27
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,9 @@ Objective-C and Objective-C++ Dialects}.
406406
-Wparentheses -Wno-pedantic-ms-format
407407
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast
408408
-Wno-pragmas -Wno-pragma-once-outside-header -Wno-prio-ctor-dtor
409-
-Wredundant-decls -Wrestrict -Wno-return-local-addr -Wreturn-type
409+
-Wno-psabi
410+
-Wredundant-decls -Wrestrict
411+
-Wno-return-local-addr -Wreturn-type
410412
-Wno-scalar-storage-order -Wsequence-point
411413
-Wshadow -Wshadow=global -Wshadow=local -Wshadow=compatible-local
412414
-Wno-shadow-ivar
@@ -6497,7 +6499,8 @@ of a derived class.
64976499

64986500
Warn about code affected by ABI changes. This includes code that may
64996501
not be compatible with the vendor-neutral C++ ABI as well as the psABI
6500-
for the particular target.
6502+
for the particular target. The latter warnings are also controlled
6503+
separately by @option{-Wpsabi}, which is implied by @option{-Wabi}.
65016504

65026505
Since G++ now defaults to updating the ABI with each major release,
65036506
normally @option{-Wabi} warns only about C++ ABI compatibility
@@ -6600,27 +6603,21 @@ This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
66006603

66016604
@end itemize
66026605

6603-
This option also enables warnings about psABI-related changes.
6604-
The known psABI changes at this point include:
6606+
@opindex Wpsabi
6607+
@opindex Wno-psabi
6608+
@item -Wpsabi @r{(C, Objective-C, C++ and Objective-C++ only)}
66056609

6606-
@itemize @bullet
6607-
6608-
@item
6609-
For SysV/x86-64, unions with @code{long double} members are
6610-
passed in memory as specified in psABI. Prior to GCC 4.4, this was not
6611-
the case. For example:
6610+
@option{-Wpsabi} enables warnings about processor-specific ABI
6611+
changes, such as changes in alignment requirements or how function
6612+
arguments are passed. On several targets, including AArch64, ARM,
6613+
x86, MIPS, RS6000/PowerPC, and S/390, these details have changed
6614+
between different versions of GCC and/or different versions of the C
6615+
or C++ language standards in ways that affect binary compatibility of
6616+
compiled code. With @option{-Wpsabi}, GCC can detect potentially
6617+
incompatible usages and warn you about them.
66126618

6613-
@smallexample
6614-
union U @{
6615-
long double ld;
6616-
int i;
6617-
@};
6618-
@end smallexample
6619-
6620-
@noindent
6621-
@code{union U} is now always passed in memory.
6622-
6623-
@end itemize
6619+
@option{-Wpsabi} is enabled by default, and is also implied by
6620+
@option{-Wabi}.
66246621

66256622
@opindex Wchanges-meaning
66266623
@opindex Wno-changes-meaning
@@ -32452,18 +32449,18 @@ and for AIX: @samp{vec-extabi}, @samp{vec-default}@.
3245232449
Change the current ABI to use IBM extended-precision long double.
3245332450
This is not likely to work if your system defaults to using IEEE
3245432451
extended-precision long double. If you change the long double type
32455-
from IEEE extended-precision, the compiler will issue a warning unless
32456-
you use the @option{-Wno-psabi} option. Requires @option{-mlong-double-128}
32457-
to be enabled.
32452+
from IEEE extended-precision, the compiler issues a warning unless
32453+
you use the @option{-Wno-psabi} option (@pxref{Warning Options}).
32454+
Requires @option{-mlong-double-128} to be enabled.
3245832455

3245932456
@opindex mabi=ieeelongdouble
3246032457
@item -mabi=ieeelongdouble
3246132458
Change the current ABI to use IEEE extended-precision long double.
3246232459
This is not likely to work if your system defaults to using IBM
3246332460
extended-precision long double. If you change the long double type
32464-
from IBM extended-precision, the compiler will issue a warning unless
32465-
you use the @option{-Wno-psabi} option. Requires @option{-mlong-double-128}
32466-
to be enabled.
32461+
from IBM extended-precision, the compiler issues a warning unless
32462+
you use the @option{-Wno-psabi} option (@pxref{Warning Options}).
32463+
Requires @option{-mlong-double-128} to be enabled.
3246732464

3246832465
@opindex mabi=elfv1
3246932466
@item -mabi=elfv1

0 commit comments

Comments
 (0)