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
4
votes
1 answer

How to get gcc's search path for Ada specs

Basic Question: How can I get gcc to tell me where it searches for Ada includes? Specific Problem: I have just finished converting a C library's header files to Ada specs so that I can interface with the library using Ada. I now want to install the…
Anthony
  • 12,177
  • 9
  • 69
  • 105
4
votes
2 answers

How would I define the __m256i data type in Ada?

I am trying to write a library for AVX2 in Ada 2012 using the GNAT GCC compiler. I have currently defined a data type Vec_256_Integer_32 like so: type Vector_256_Integer_32 is array (0 .. 7) of Integer_32; pragma Pack(Vec_256_Integer_32); Note that…
Alex F.
  • 71
  • 6
4
votes
1 answer

Ada GPS IDE can't seem to find GtkAda

I have installed both the GNAT Programming Studio (GPS) and GtkAda. They both seem to work fine, but when I try to build the Simple Window project under New Project from Template, I get a bunch of errors saying "file gtk.ads not found." This seems…
Gautam
  • 1,732
  • 4
  • 18
  • 26
4
votes
3 answers

How to Run Ada Code in GPS

In GNAT Programming Studio, how do you run the program? I see it compiled successfully, but I do not see where my program has started running. I would like to test it.
Misty
  • 311
  • 5
  • 12
4
votes
1 answer

How can I access a symbol from the linker script in my Ada code?

I am building my Ada/SPARK project using GNAT and I am using a linker script. Here is an excerpt: SECTIONS { .code : { . = ALIGN(0x4); *(.text.section1) _end_of_section1 = .; *(.text.section2) ... …
Nola
  • 436
  • 4
  • 12
4
votes
2 answers

Failed assert that libsparkcrypto SHA256 results are equal

Summary of my issue I am using the libsparkcrypto library for my SHA256 function. I am finding that I cannot Assert that x = y implies Sha256(x) = Sha256(y). Any help would be greatly appreciated. Code testpackage.adb package body TestPackage with …
4
votes
2 answers

Is this a bug with UTF conversion in GNAT Ada

I am trying to convert from UTF 16 to UTF 8; this is a test program: with Ada.Text_IO; with Ada.Strings.UTF_Encoding.Conversions; use Ada.Text_IO; use Ada.Strings.Utf_Encoding.Conversions; use Ada.Strings.UTF_Encoding; procedure Main is Str_8:…
A. Matić
  • 73
  • 5
4
votes
3 answers

No GNATtest in GNAT Community Edition?

When I try to generate unit tests in GNAT 2020 Community Edition (Windows 10 64 bit), I get an error on missing gnattest tool: could not locate gnattest. Same happens on Ubuntu 20.04 (in WSL) with package gnat-10: could not locate…
kirk
  • 125
  • 1
  • 5
4
votes
1 answer

Can I put pragma `Inline` in the body instead of the spec?

Ada Information Clearinghouse states the following: The use of pragma Inline does have its disadvantages. It can create compilation dependencies on the body; that is, when the specification uses a pragma Inline, both the specification and…
Rodeo
  • 151
  • 9
4
votes
2 answers

Strange compilation error with gnat on fixed point declaration

Compilation fails with the F6 declaration below : type F3 is delta 2.0**(-4) range 0.0 .. ((2.0**8)-1.0)*2.0**(-4); -- byte 16#f.f#; for f3'size use 8; type F4 is delta 2.0**(-8) range 0.0 .. ((2.0**16)-1.0)*2.0**(-8); -- word 16#ff.ff# for…
4
votes
2 answers

Passing struct/record from assembler to Ada

I'm attempting to pass a structure from (x86) assembler to Ada on the stack. I've been able to successfully use this pattern in C to accept to wrap a large number of arguments passed from assembly inside a struct and I'm wondering if this will work…
ajxs
  • 3,347
  • 2
  • 18
  • 33
4
votes
1 answer

How to find out if an Ada file was compiled using static or dynamic elaboration

I am having some issues with detected elaboration circularities. I am almost sure that all the sources were compiled with -gnatE. To further investigate this I would like to check in the ada lib directory if a file was compiled with static or…
dwjbosman
  • 906
  • 9
  • 33
4
votes
1 answer

Passing multiple link libraries in GPR file

Is it possible to pass multiple objects to the linker via an environment variable in GNAT? I have a situation where I have an environment variable (let's call it LINKLIBS) that I have included a space-separated list of extra libraries to be brought…
ereisch
  • 194
  • 1
  • 8
4
votes
2 answers

Ada lookup table not working when calling Ada from C

I'm working on some Ada code which I have to call from C and I've encountered a problem which I can't solve and don't know why it's happening. Here is a test project to illustrate the problem: lookup.ads with Interfaces.C; use Interfaces.C; package…
Zoltán
  • 678
  • 4
  • 15
4
votes
3 answers

How do I compile and link using gnatmake with an Ada shared library?

I am having trouble compile an applicant again the Florist library. Turns out I have a larger issue with florist (same error results from both newest 2010 Adacore GPL download and 2009 version in Debian's archive). Florist has some low-level issues…
Josh
  • 257
  • 2
  • 8
1 2
3
28 29