]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: adjust comment about ignored pragma warnings
authorTobias Klauser <tklauser@distanz.ch>
Thu, 7 Mar 2019 07:33:01 +0000 (08:33 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Fri, 8 Mar 2019 07:58:16 +0000 (07:58 +0000)
The warnings are not strictly tied to FreeBSD but to the clang version.
People could still be building with an old version of clang even if not
on FreeBSD. The -Wpragmas and -Waddress-of-packed-member warnings were
introduced in clang 4.0, so also adjust the comment accordingly.

This was discussed as part of CL 160777 which introduced these comments.

Updates #27619

Change-Id: I4988ffd08797dcc72cdc264d4abd20a114f70473
Reviewed-on: https://go-review.googlesource.com/c/go/+/165800
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/cgo/out.go

index bb0d016fa55b42a73d16279f5c6f8f9eddd7a500..d00c990d63dba855b7899d3f474fbeb66c418426 100644 (file)
@@ -777,8 +777,8 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
        fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n\n")
 
        // We use packed structs, but they are always aligned.
-       // The pragmas and address-of-packed-member are not recognized as warning groups in clang 3.4.1, so ignore unknown pragmas first.
-       // remove as part of #27619 (all: drop support for FreeBSD 10).
+       // The pragmas and address-of-packed-member are only recognized as
+       // warning groups in clang 4.0+, so ignore unknown pragmas first.
        fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n")
        fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wpragmas\"\n")
        fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Waddress-of-packed-member\"\n")
@@ -1480,10 +1480,11 @@ __cgo_size_assert(double, 8)
 
 extern char* _cgo_topofstack(void);
 
-/* We use packed structs, but they are always aligned.  */
-/* The pragmas and address-of-packed-member are not recognized as warning groups in clang 3.4.1, so ignore unknown pragmas first. */
-/* remove as part of #27619 (all: drop support for FreeBSD 10). */
-
+/*
+  We use packed structs, but they are always aligned.
+  The pragmas and address-of-packed-member are only recognized as warning
+  groups in clang 4.0+, so ignore unknown pragmas first.
+*/
 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
 #pragma GCC diagnostic ignored "-Wpragmas"
 #pragma GCC diagnostic ignored "-Waddress-of-packed-member"