aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-08-10 17:26:09 +0200
committerTom de Vries <tdevries@suse.de>2020-08-10 17:26:09 +0200
commitb3f8962bdb903bf8bc37935c189b3b32ad667c0b (patch)
tree2969b6d041fc19efb2633210c0bf655e40452b68 /sim/common
parentf7cb161ea6ffee167de3126023b2ce0fffd84076 (diff)
downloadgdb-b3f8962bdb903bf8bc37935c189b3b32ad667c0b.zip
gdb-b3f8962bdb903bf8bc37935c189b3b32ad667c0b.tar.gz
gdb-b3f8962bdb903bf8bc37935c189b3b32ad667c0b.tar.bz2
[sim] Fix mbuild build breaker in sim-cpu.c
When running gdb/gdb_mbuild.sh, I run into: ... src/sim/aarch64/../common/sim-cpu.c: In function 'sim_cpu_free': src/sim/aarch64/../common/sim-cpu.c:64:3: error: implicit declaration of \ function 'free' [-Werror=implicit-function-declaration] free (cpu); ^~~~ src/sim/aarch64/../common/sim-cpu.c:64:3: error: incompatible implicit \ declaration of built-in function 'free' [-Werror] src/sim/aarch64/../common/sim-cpu.c:64:3: note: include '<stdlib.h>' or \ provide a declaration of 'free' ... Fix this by adding "#include <stdlib.h>". Tested by gdb/gdb_mbuild.sh -e aarch64-elf. sim/common/ChangeLog: 2020-08-10 Tom de Vries <tdevries@suse.de> * sim-cpu.c: Include stdlib.h for free.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog4
-rw-r--r--sim/common/sim-cpu.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index a1ac3f1..2c71b13 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,7 @@
+2020-08-10 Tom de Vries <tdevries@suse.de>
+
+ * sim-cpu.c: Include stdlib.h for free.
+
2020-01-19 Simon Marchi <simon.marchi@polymtl.ca>
* nrun.c: Include stdlib.h.
diff --git a/sim/common/sim-cpu.c b/sim/common/sim-cpu.c
index 1715508..d1676d4 100644
--- a/sim/common/sim-cpu.c
+++ b/sim/common/sim-cpu.c
@@ -17,6 +17,8 @@ GNU General Public License for more details.
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 <stdlib.h>
+
#include "sim-main.h"
#include "bfd.h"