Questions tagged [gnat]

the GNU Ada compiler that comes as part of GCC (the GNU Compiler Collection including the GNU C Compiler). This tag includes all the various versions of GNAT: • GNAT Community Edition as released by AdaCore under GPL, • FSF as available with gcc distributions under GPL with Runtime Library Exception, and • GNAT Pro under proprietary license from AdaCore.

When under development through a USA Department of Defense contract, GNAT was originally an acronym for The GNU NYU Ada 9X Translator. GNAT is a Ada-language front end in the GNU Compiler Collection (GCC) that adorns the GCC C/C++ GIMPL semantic tree with Ada semantics. This GIMPLE semantic tree is then fed into the Register Transfer Language (RTL) backend of GCC to produce assembly language and/or machine code. Modern GNAT also has an LLVM backend as well.

424 questions
3
votes
3 answers

GNAT support for ARM bare metal development boards

As a hobby project, I'd like to learn development on "bare metal" with Ada. It seems GNAT compiler has support for various development boards and provides a few different runtimes - zfp, ravenscar-sfp, ravenscar-full. I'm not quite sure which MCU…
user8996961
3
votes
2 answers

Bug in AUnit which comes with GNAT

I believe I have found and fixed a bug in AUnit which comes as part of the GNAT compiler tools for Ada. What is the best way to submit bugs to AdaCore for their community versions of the GNAT tools? The following program silently aborts with the…
Wayne
  • 66
  • 4
3
votes
2 answers

"Taking on a Challenge in SPARK Ada" - Sum ghost function in post-condition having unintended behavior

I am writing a piece of software in SPARK Ada which requires the post-condition to verify that the function return value is equal to the summed values of an array. Upon proving the file where the function resides, I keep getting an error which…
3
votes
1 answer

Why am I getting "storage error" on my Ada shared library when running under a JVM

We have an Ada shared library compiled by GnatPro 19.2 that we're calling through a JNA call. Our application runs fine under windows. When porting it under Linux, the application crashes randomly with an Ada exception: storage error or erroneous…
Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
3
votes
2 answers

Updating the Compiler for the GPS Community Edition 2019 IDE

I've recently started working on a project that requires my complier to be above GNAT 4.8.5 - When I go to: Help > About You can see that the version I'm using is 4.8.5 Also, when I run the gnatls -v command, I can see…
Lloyd Thomas
  • 345
  • 2
  • 12
3
votes
2 answers

I2C returning Busy or Error on memory reading

I started the following code to handle a Bosch BME280 sensor with a Nucleo-F446ZE and a Nucleo-F411RE boards. with STM32.Device; use STM32.Device; with STM32.GPIO; use STM32.GPIO; with STM32; use STM32; with STM32.I2C; with HAL.I2C; use…
Frédéric Praca
  • 1,620
  • 15
  • 29
3
votes
0 answers

Refactoring: Removing renamed packages (automatically)

Ada supports the renaming of packages (see here). Unfortunately I have to work on some legacy Ada code and the previous developer renamed packages excessively: more than 100 renames in a single package specification/body are not unusual. In my…
Marcello90
  • 1,313
  • 4
  • 18
  • 33
3
votes
1 answer

Tracing execution of an Ada program

Does Ada/GNAT supports something like the automatic tracing of the execution of a program (or selected packages/procedures/functions) for debug purposes? I am not interested in a logger package. Imagine working on a real old Ada project and using a…
Marcello90
  • 1,313
  • 4
  • 18
  • 33
3
votes
1 answer

Start executable from Ada program and read result

I found this question and the first answer contains some example code demonstrating how to start an executable with Ada code. The output of the executable is written to the standard output. What options do I have to read the output of the executable…
Marcello90
  • 1,313
  • 4
  • 18
  • 33
3
votes
1 answer

GPRBuild does not compile C files

I upgraded to GNAT Community 2018 (everything worked fine with GNAT GPL 2017). I have this project file: with "opengl"; library project OpenGL.Soil is for Library_Name use "SoilAda"; for Languages use ("ada", "c"); for Source_Dirs use…
flyx
  • 35,506
  • 7
  • 89
  • 126
3
votes
2 answers

Ada Slicing with Strings

I'm a long time C++ programmer learning Ada for fun. If any of the following is bad form, please feel free to point it out. I'm trying to learn the Ada way to do things, but old habits are hard to break (and I miss Boost!) I'm trying to load a…
Dr. Watson
  • 3,752
  • 4
  • 32
  • 43
3
votes
2 answers

Package not visible error

I've having trouble with package visibility. I have a really simple package and the code is listed below. The error message is shown here: viterbi.adb:12:14: "Integer_Text_IO" is not visible (more references follow) viterbi.adb:12:14: non-visible…
Dr. Watson
  • 3,752
  • 4
  • 32
  • 43
3
votes
3 answers

Printing the exception message in an Ada Last_Chance_Handler

I'm in the process of learning Ada using the GNAT compiler using the AdaCore GPS (GPL) IDE, aimed at ARM "bare board" hardware (STM32F4 using a Ravenscar SFP runtime). For my ARM based embedded work I've come from a C/C++ background. Anyway, I've…
Max van Daalen
  • 317
  • 2
  • 14
3
votes
1 answer

GPRBuild does not find gprconfig when called from the Windows Subsystem for Linux

I have installed GNAT GPL 2017 on my Windows 10 system. Now I want to call the compiler from within a linux shell running on the Windows Subsystem for Linux. By adding the bin directory of my GNAT installation to the PATH, I got the following to…
flyx
  • 35,506
  • 7
  • 89
  • 126
3
votes
1 answer

GNAT GPL 2017 gnatcoll.xref disappeared?

I'm trying to upgrade to GNAT GPL 2017 (from 2016). I'm running on Windows 8.1. One application uses gnatcoll.xref. In 2016, that's found in: gnat/include/gnatcoll/gnatcoll_sqlite.static/gnatcoll-xref.ads However, the file is not found in the 2017…
Stephen Leake
  • 164
  • 1
  • 8