public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: Move defs.h before any system header in debuginfod-support.c
@ 2020-03-02 13:00 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2020-03-02 13:00 UTC (permalink / raw)
  To: gdb-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2190 bytes --]

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a84bb2a0790125f5fb5df65b7873fb6076164527

commit a84bb2a0790125f5fb5df65b7873fb6076164527
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sat Feb 29 13:33:35 2020 +0000

    gdb: Move defs.h before any system header in debuginfod-support.c
    
    * defs.h includes config.h
    * config.h may define _GNU_SOURCE
    * if _GNU_SOURCE is defined, that must be before including any system
    header (see feature_test_macro(7))
    
    This is necessary to ensure that a prototype for mkostemp() is brought
    into scope by <stdlib.h> when compiling filestuff.h, on platforms where
    _GNU_SOURCE isn't unconditionally defined for C++.
    
    In file included from ../../gdb/../gdbsupport/scoped_fd.h:24,
                     from ../../gdb/debuginfod-support.c:22:
    ../../gdb/../gdbsupport/filestuff.h: In function ‘int gdb_mkostemp_cloexec(char*, int)’:
    ../../gdb/../gdbsupport/filestuff.h:59:10: error: ‘mkostemp’ was not declared in this scope; did you mean ‘mkstemp’?
    
    gdb/ChangeLog:
    
    2020-02-29  Jon Turney  <jon.turney@dronecode.org.uk>
    
    	* debuginfod-support.c: Include defs.h first.

Diff:
---
 gdb/ChangeLog            | 4 ++++
 gdb/debuginfod-support.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5f49542..591ef40 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-02-29  Jon Turney  <jon.turney@dronecode.org.uk>
+
+	* debuginfod-support.c: Include defs.h first.
+
 2020-02-28  Tom de Vries  <tdevries@suse.de>
 
 	* symfile.c (set_initial_language): Use default language for lookup.
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
index e0f0fac..f4a227b 100644
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -16,8 +16,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
 #include "defs.h"
+#include <errno.h>
 #include "cli/cli-style.h"
 #include "gdbsupport/scoped_fd.h"
 #include "debuginfod-support.h"


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-02 13:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 13:00 [binutils-gdb] gdb: Move defs.h before any system header in debuginfod-support.c Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).