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

Ada program on Linux: SIGSEGV due to missing file?

I've compiled an Ada program for Linux on Ubuntu 5.4 (GNAT 3.4) using the following command: gnatmake -O3 myprogram -bargs -static When I run the program on the Ubuntu machine then, it works fine. But on another machine (Linux webserver), I get the…
caw
  • 30,999
  • 61
  • 181
  • 291
2
votes
2 answers

Calling scanf from Ada

How do you call scanf from Ada? That is, presumably with an appropriate pragma import declaration, but what would the declaration look like? (I'm interested in how to call C functions of the more unruly variety from Ada, not how to parse strings per…
rwallace
  • 31,405
  • 40
  • 123
  • 242
2
votes
2 answers

Ada scale exceeds maximum value of 18

Dear Ada Enthusiasts, type Long_Money_Type is delta 10.0**(-22) digits 38; On The First Machine Ubuntu Linux 64 bit GNAT 8.3.0 this works. On The Second Machine Alpine Linux 64 Bit GNAT 10.3.1 20211027 i get this error: adx-lib-money.ads:14:29:…
mcxbain
  • 89
  • 5
2
votes
2 answers

How to use unicode in GNAT Programming Studio?

I am using the GPS to programming. But I can't use unicode characters in code. I set the Character Set as UTF-8 in preferences. But I still could not type the unicode characters as comment in the code. Can anyone tell me how to use unicode…
sunny2016
  • 1,345
  • 3
  • 13
  • 22
2
votes
1 answer

Ada - strange error - consistent version of gcc/gnatbind

i'm trying to compile an Ada project. I installed the current 2011 GNAT GPL package from Libre AdaCore, it contains the gcc compiler too. The strange error is the following fatal error: file dom.ali is incorrectly formatted make sure you are using…
michele
  • 65
  • 1
  • 3
  • 10
2
votes
0 answers

GPRbuild: relocation truncated to fit R_X86_64

I'm dealing with huge global lists in Ada. When building I'm getting the error during linking: relocation truncated to fit R_X86_64_PC32 and link of main.adb failed. I saw that GCC has the flag -mcmodel=medium, is there something similar for…
Nessa3001
  • 91
  • 2
2
votes
0 answers

How is Ada and GPR supposed to handle conditional compilation?

I'm rewriting C source to Ada and on some places there is conditional compilation for handling different platforms, such as windows vs posix, DEBUG, or architecture. For what I can tell neither Ada nor GPR has the notion of conditional…
Andreas
  • 5,086
  • 3
  • 16
  • 36
2
votes
4 answers

Ada Gnat project which includes differently-named files for different build configurations

I have a Gnat/Gprbuild project with several build configurations. I have a main source file and an secondary ads file which the main source file includes: with Secondary_File; use Secondary_File; The problem is that in each configuration, the…
Nola
  • 436
  • 4
  • 12
2
votes
1 answer

Analysis of a hung/stuck program

I have to maintain an (old) Ada program that loads multiple DLLs (plugins) dynamically after its own start on Windows. Each DLL defines an entry point procedure that is called from the main program. When this entry point procedure is called each DLL…
Marcello90
  • 1,313
  • 4
  • 18
  • 33
2
votes
1 answer

Issue with option arguments in GNAT.Command_Line

I'm having an issue parsing input arguments in Ada using the GNAT.Command_Line package. I've modeled my approach based off resources such as this Ada Gem as well as this answer, but can't seem to get the argument-accepting switches working…
ecfedele
  • 306
  • 3
  • 15
2
votes
1 answer

Thick binding dynamic library: Undefined references

What I did so far on my Linux Mint system: Write a thin binding to the GSL library Write a thick binding based on the thin binding Write a test program for 1. Write a test program for 2. When I create static libraries, everything works fine. When…
hreba
  • 107
  • 1
  • 8
2
votes
1 answer

How do I handle uninitialized data in a dynamic predicate in Ada?

This is some simplified code I haven't tested as is (so it may contain errors) that demonstrates the problem I'm experiencing: type Space is private; --Depending on members of Space, determines whether Outer fully contains Inner function…
Devsman
  • 434
  • 4
  • 17
2
votes
1 answer

How To Copy data from String access to Ada.String

I have the following fragment of code with GNAT.Command_Line; use GNAT.Command_Line; with GNAT.Strings; use GNAT.Strings; .... Define_Switch (Config => Config, Output => File_Name'Access, Long_Switch =>…
Alexander
  • 342
  • 4
  • 14
2
votes
2 answers

How to bind to OpenCV for GNAT?

Can anybody tell me how to find or create a binding to OpenCV for GNAT? I want to use Ada2005 to implement some program with OpenCV (1.0 or 2.X), but I don't know how. Can anybody teach me how to do it?
sunny2016
  • 1,345
  • 3
  • 13
  • 22
2
votes
3 answers

Can a variable passed with 'address attribute to a procedure be modified?

In my test code below, I am trying to modify a variable by passing it as system.address to another procedure. with Ada.Text_IO; with System; with System.Storage_Elements; procedure Main is procedure Modify ( Var : in out System.Address) is …
MVSR
  • 23
  • 4