Re: [PATCH] Fix PR ada/111813 (Inconsistent limit in Ada.Calendar.Formatting)

2023-10-19 Thread Arnaud Charlet
Hi Simon, > Pierre-Marie, I’ve CC’d you hoping you’re an appropriate person to ping on > this one. > If not, who would be for this sort of change? > > I should have said, tested by > - add test case, make -C gcc check-gnat: error reported > - make -C gcc gnatlib_and_tools; make install > - make

Re: [PATCH, Ada] RISC-V: Initial riscv linux Ada port.

2018-07-06 Thread Arnaud Charlet
> Ada is a low priority side project for me, so if you want non-trivial changes > it may be a while before I can get to them. There is a lot of other stuff > higher on my priority list at the moment, such as getting native gdb support > working. If this isn't OK as is, then I'm willing to put wor

Re: [PATCH, Ada] Makefile patches from initial RISC-V cross/native build.

2018-07-06 Thread Arnaud Charlet
> These are some patches I needed to complete my cross build of a native > riscv linux Ada compiler. Some paths were different on the build machine > and host machine. I needed to pass options into gnatmake to work around this, > and that required fixing some makefile rules to use $(GNATMAKE) ins

Re: [PATCH, Ada] RISC-V: Initial riscv linux Ada port.

2018-07-07 Thread Arnaud Charlet
> I tried adding the missing definition. I now get > > === acats Summary === > # of expected passes2320 > # of unexpected failures0 > > === gnat Summary === > > # of expected passes2779 > # of unexpected failures4 > # of ex

Re: [PATCH] Introduce instance discriminators

2018-07-31 Thread Arnaud Charlet
>>> Ok to install the first two patches? (the third is just for reference) >> >> Ping? >> >> https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01419.html > > OK for the middle-end parts, the Ada parts need separate approval > (maybe CC a maintainer). Ok for the Ada part. Arno

Re: [PATCH] Fix PR ada/111813 (Inconsistent limit in Ada.Calendar.Formatting)

2023-10-24 Thread Arnaud Charlet
This change is OK, thank you. > The description of the second Value function (returning Duration) (ARM > 9.6.1(87) > doesn't place any limitation on the Elapsed_Time parameter's value, beyond > "Constraint_Error is raised if the string is not formatted as described for > Image, or > the funct

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-03 Thread Arnaud Charlet
Hi Simon, In addition to the non portable issues already mentioned, this change isn't OK also for other reasons. Basically this function is global and decides once for all on the case sensitivity, while the case sensitiviy is on a per filsystem basis as you noted. So without changing fundament

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-06 Thread Arnaud Charlet
> > So without changing fundamentally the model, you can't decide dynamically > > for the whole > > system. Making the choice based on the current directory is pretty random, > > since the current > > directory isn't well defined at program's start up and could be pretty much > > any filesystem.

Re: [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)

2021-02-05 Thread Arnaud Charlet
> This fixes the bootstrap failure with Ada on Cygwin since the switch > to C++11. The configure checks detect that fileno_unlocked () is > present, but when Ada's cstreams.c is compiled in C++11 mode, > does not declare it, causing a hard error. > > Fixed by defining _GNU_SOURCE before including

Re: [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)

2021-02-05 Thread Arnaud Charlet
> > We'd rather not have PR references in the source files, so please remove it > > (it will be there as part of the commit log and git annotate). > > > > OK with the comment updated. > > Thanks, here's the revised patch. OK, thanks. > gcc/ada/ > > 2021-02-05 Mikael Pettersson > > P

Re: [PATCH v2 2/2] ada: add 128bit operation to MIPS N32 and N64

2021-02-17 Thread Arnaud Charlet
+ : add 128Bit operation file to MIPS N64 and N32. > + > 2021-02-12 Arnaud Charlet > > * repinfo.ads, repinfo.adb (*SO_Ref*): Restore. > diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl > index 35faf13ea46..d86eb8acbf3 100644 > --- a/gcc/ada/Makefile

Re: [PATCH v2 2/2] ada: add 128bit operation to MIPS N32 and N64

2021-02-18 Thread Arnaud Charlet
> > > For MIPS N64 and N32: > > > add GNATRTL_128BIT_PAIRS to LIBGNAT_TARGET_PAIRS > > > add GNATRTL_128BIT_OBJS to EXTRA_GNATRTL_NONTASKING_OBJS > > > > > > gcc/ada/ChangeLog: > > > PR ada/98996 > > > * Makefile.rtl (LIBGNAT_TARGET_PAIRS, EXTRA_GNATRTL_NONTASKING_OBJS) > > >

Re: [PATCH v3 2/2] ada: add 128bit operation to MIPS N32 and N64

2021-02-23 Thread Arnaud Charlet
> For MIPS N64 and N32: > add GNATRTL_128BIT_PAIRS to LIBGNAT_TARGET_PAIRS > add GNATRTL_128BIT_OBJS to EXTRA_GNATRTL_NONTASKING_OBJS > > gcc/ada/ChangeLog: > PR ada/98996 > * Makefile.rtl: add 128Bit operation file to MIPS > N64 and N32 (LIBGNAT_TARGET_PAIRS, EXTRA_GNATRTL_

Re: [PATCH v3 2/2] ada: add 128bit operation to MIPS N32 and N64

2021-02-23 Thread Arnaud Charlet
> > > For MIPS N64 and N32: > > > add GNATRTL_128BIT_PAIRS to LIBGNAT_TARGET_PAIRS > > > add GNATRTL_128BIT_OBJS to EXTRA_GNATRTL_NONTASKING_OBJS > > > > > > gcc/ada/ChangeLog: > > > PR ada/98996 > > > * Makefile.rtl: add 128Bit operation file to MIPS > > > N64 and N32 (LIBGN

Re: [PATCH v3 2/2] ada: add 128bit operation to MIPS N32 and N64

2021-02-23 Thread Arnaud Charlet
>>> I did generate the ChangeLog by contrib/mklog.py by: >>> contrib/mklog.py 0002_MY_PATCH.patch >>> and get an empty ChangeLog template. >>> >>> gcc/ada/ChangeLog: >>> >>>* ChangeLog: >>>* Makefile.rtl: >>> >>> So, should I keep it as is? >> >> The ChangeLog file is gene

Re: [PATCH v2] fix Ada bootstrap on Cygwin64 (PR bootstrap/94918)

2021-03-07 Thread Arnaud Charlet
> > > > This fixes a compilation error preventing bootstrap with Ada on > > > > x86_64-pc-cygwin. See PR bootstrap/94918 for details. > > > > > > > > Compared to the initial patch sent in May 2020, this v2 patch places > > > > the fix in Ada's raise-gcc.c instead of the shared unwind-generic.h, > >

Re: [PATCH] Ada: hashed container Cursor type predefined equality non-conformance

2021-03-09 Thread Arnaud Charlet
Richard, Your patch is missing a corresponding commit log. Can you please add it to your submission? Otherwise your test and patch look good so far, thanks! Arno > We discovered an issue with the GNAT implementation of the hashed container > types.

Re: [ADA PATCH] Fix locales.c iso_3166 bug

2019-10-27 Thread Arnaud Charlet
> My script to check for PR79475-like issues discovered what looks like a bug > in the Ada FE. I actually have no idea how it can work properly for any > entries after the last US entry or "United-States", because it will only > match United-StatesUY to US or UZ to Uruguay etc., rather than > Unit

Re: r272976 - in /trunk/gcc/ada: ChangeLog ali.adb ...

2019-10-28 Thread Arnaud Charlet
> > 2019-09-10 Arnaud Charlet > > > > * doc/install.texi: Fix syntax for html generation. > > > > Index: doc/install.texi > > === > > --- doc/install.texi(revision 275400)

Re: r272976 - in /trunk/gcc/ada: ChangeLog ali.adb ...

2019-11-05 Thread Arnaud Charlet
> That should be @uref{prerequisites.html#GNAT-prerequisite,,GNAT > prerequisites}. Thanks. I wouldn't have been able to guess that! Corresponding patch installed. 2019-11-05 Arnaud Charlet * doc/install.texi: Further fix syntax for html generation. Index: doc/i

Re: [pushed] Ada : Fix bootstrap after r11-4793.

2020-11-09 Thread Arnaud Charlet
> Iain, thank you for catching and fixing this. As you know (but > others don't), ada is harder for me as I can't build that on my > usual machine. > > Eric, Iain does bootstraps of the modules branch on darwin include > Ada, and I have done so for linux (a few months back). I will make > sure t

Re: [PATCH 2/2] libada: Check for the presence of _SC_NPROCESSORS_ONLN

2020-11-15 Thread Arnaud Charlet
> gcc/ada/ > * adaint.c (__gnat_number_of_cpus): Check for the presence of > _SC_NPROCESSORS_ONLN before using it. > --- > NB we could probably replace the list of OS #ifdefs with just a check for > _SC_NPROCESSORS_ONLN, making use of it automagically with any new OS that > sup

Re: [PATCH] Fix sphinx-build warning.

2021-05-25 Thread Arnaud Charlet
> RemovedInSphinx40Warning: app.add_lexer() API changed; Please give lexer > class instead of instance > > Ready for master? Yes, thanks (incidentally we just made the same change in our internal tree today). > Thanks, > Martin > > gcc/ada/ChangeLog: > > * doc/share/conf.py: Fix Sphinx

Re: [PATCH 1/3] Come up with startswith function.

2021-04-25 Thread Arnaud Charlet
> Thank you for a quick reply. > There's an updated version of the patch. The Ada part is OK now, thanks.

Re: [PATCH] ada: do not use binary mode in conf.py

2021-05-12 Thread Arnaud Charlet
> It's about more porting to Python3. > > Ready for master? OK, thanks. > gcc/ada/ChangeLog: > > * doc/share/conf.py: Do not use binary mode. > Do not use u' literals as Python3 uses unicode by default.

Re: [PATCH] Port gnat-style to Sphinx.

2021-05-14 Thread Arnaud Charlet
> Right now, 2/3 of Ada manuals are both in .texi and .rst. I would like to port > a small gnat-style manual based on [1]. > > Ready for master? OK, thanks. > [1] https://github.com/davidmalcolm/texi2rst > > gcc/ada/ChangeLog: > > * doc/Makefile: Add gnat-style target. > * doc/shar

Re: [PATCH] ada: Fix Ada bootstrap on Solaris

2023-12-04 Thread Arnaud Charlet
> The recent warning patches broke Ada bootstrap on Solaris: > > adaint.c: In function '__gnat_kill': > adaint.c:3597:3: error: implicit declaration of function 'kill' > [-Wimplicit-function-declaration] > 3597 | kill (pid, sig); > | ^~~~ > > expect.c: In function '__gnat_expect_poll'

Re: [PATCH] Fix PR ada/111813 (Inconsistent limit in Ada.Calendar.Formatting)

2023-11-09 Thread Arnaud Charlet
Marc, can you please take care of it when you get a chance? On Thu, Nov 09, 2023 at 11:22:21AM +, Simon Wright wrote: > On 24 Oct 2023, at 10:49, Arnaud Charlet wrote: > > > > This change is OK, thank you. > > Can it be committed, then, please? > > >> Th

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-13 Thread Arnaud Charlet
> >>> OK, I thought there would be some defines that we could use for that, too > >>> bad if there isn't > >>> and indeed we might need to perform another runtime check then as > >>> suggested by Iain. > >> > >> I can see a possible interface, operatingSystemVersion in NSProcessInfo.h > >> - Ob

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-17 Thread Arnaud Charlet
> Also, should the test code below (between %%%) be included in the > testsuite? It would be good but tests shouldn't output anything, they should be self testing, and you will need to deal with making the test portable to all targets. Given that the compiler itself uses this feature, I don't th

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-17 Thread Arnaud Charlet
> > Please simplify the above to (untested): > > > > #elif defined (__APPLE__) > >/* By default, macOS volumes are case-insensitive, iOS > > volumes are case-sensitive. */ > > #if TARGET_OS_MAC/* macOS, in older SDK. */ > > file_names_case_sensitive_cache = 0; > > #

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-17 Thread Arnaud Charlet
> Apple’s naming is definitely confusing in this area! > > In current SDKs, TARGET_OS_MAC means code is being generated for a Mac OS X > variant, > which covers OSX, IOS, Watch … ; to determine which kind of device, you have > to check the > specific define for that device - OSX corresponds to

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-17 Thread Arnaud Charlet
> OK so then the following is sufficient for our needs: > > #elif defined (__APPLE__) >/* By default, macOS volumes are case-insensitive, iOS > volumes are case-sensitive. */ > #if TARGET_OS_IOS > file_names_case_sensitive_cache = 1; > #else > file_names_case_

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-22 Thread Arnaud Charlet
> >> #if defined (__APPLE__) > >> -#include > > > > If removing unistd.h is intentional (i.e. you determined that it’s no longer > > needed for Darwin), then we should make that a separate patch. > > I thought that I’d had to include unistd.h for the first patch in this > thread; clearly not! >

Re: [RFC] GCC Security policy

2023-09-20 Thread Arnaud Charlet
This is a great initiative I think. See reference to AdaCore's security email below (among Debian, Red Hat, SUSE) On Mon, Aug 7, 2023 at 7:30 PM David Edelsohn via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > FOSS Best Practices recommends that projects have an official Security > policy stat

Re: [PATCH 1/1] ada: Make the names of uninstalled cross-gnattools consistent across builds

2024-07-04 Thread Arnaud Charlet
The change is OK, thanks. > We suffer from an inconsistency in the names of uninstalled gnattools > executables in cross-compiler configurations. The cause is a recipe we > have: > > ada.all.cross: > for tool in $(ADA_TOOLS) ; do \ > if [ -f $$tool$(exeext) ] ; \ > then \

Re: [PATCH v8] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2024-05-15 Thread Arnaud Charlet
Nicolas, Thank you for such a large and delicate change! This looks generally good, except for the first parts: we cannot change documented/user packages, meaning that GNAT.Calendar, System.OS_Lib (via the documented GNAT.OS_Lib) and Ada.Calendar.Conversion cannot be changed: we need to keep th

[Ada] Missing aspect specifications on bodies, renamings and stubs

2013-09-10 Thread Arnaud Charlet
This patch allows the compiler to parse and analyze aspect specifications that apply to package bodies, protected bodies, task bodies, [generic] renaming declarations, and body stubs. -- Source -- -- bodies.adb package body Bodies with Warnings => On is protected bo

[Ada] Proper handling of aspects on a compilation unit package instance

2013-09-10 Thread Arnaud Charlet
This patch implements properly the handling of categorization aspects that apply to a package instantiation. Compiling inst.ads must yield: inst.ads:1:06: cannot depend on "Gen" (wrong categorization) inst.ads:1:06: pure unit cannot depend on non-pure unit generic type T is private; package G

[Ada] Don't allow REASON parameter for pragma Warnings in compiler unit

2013-09-10 Thread Arnaud Charlet
This patch forbids the use of the pragma Warnings REASON parameter in compiler units (since this would cause bootstrap issues). This is for internal development purposes only. No functionality change. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-09-10 Robert Dewar * sem_prag

[Ada] Warn if -gnateE specified and cannot be supported

2013-09-10 Thread Arnaud Charlet
This implements a warning that is output if the switch -gnateE (Extra Exception Information) is specified on the command line, and the configuration in use does not support it (true of configurable run-times with the restriction No_Exception_Handlers or No_Exception_Propagation. If a trivial progra

[Ada] Infinite loop while analysing aspect Global

2013-09-10 Thread Arnaud Charlet
This patch corrects the check of a Global item of mode In_Out or Out that appear as an input in the Global aspect of an enclosing subprogram. Prior to this patch, the check caused an infinite loop in certain scenarios. -- Source -- -- stack_overflow.adb procedure Stack

[Ada] Add For_Each and Sort_Table procedures to GNAT.Table

2013-09-10 Thread Arnaud Charlet
This patch adds the procedures For_Each and Sort_Table to GNAT.Table making its interface more similar to that of GNAT.Dynamic_Tables. The following test: 1. with GNAT.Table; 2. with Text_IO; use Text_IO; 3. procedure GTableTestFS is 4.package T is new GNAT.Table 5.

[Ada] Give error if both -gnatR and -gnatc given

2013-09-10 Thread Arnaud Charlet
The use of -gnatR in check semantics only (-gnatc) mode does not work since code must be generated for -gnatR to work. The attempt to combine the two switches is now properly diagnosed. The following trivial package 1. package gnatrgnatc is 2. end; If compiled with switches -gnatc -gnat

[Ada] Improve error msgs for Ada 2012 feature not in Ada 2012 mode

2013-09-10 Thread Arnaud Charlet
Previously if an Ada 2012 feature was used in an earlier Ada mode, the error message always advised the use of the -gnat2012 switch. But that is not helpful if the mode was set by an explicit use of pragma Ada_xx. This patch improves the error message in this case by pointing to the relevant pragma

[Ada] Avoid reading past end of file when checking for BOM

2013-09-10 Thread Arnaud Charlet
This patch makes sure that the routine Check_For_BOM cannot read past the end of file. In practice it is probably the case that this cannot cause a real error, but valgrind can see that this is happening. So this change will avoid the annoying false positive from valgrind. It's not worth setting up

[Ada] Don't delete real errors with specific warning control

2013-09-10 Thread Arnaud Charlet
The pragma Warnings (Off, msg) is intended only to delete warnings, but it was deleting real errors as well. This patch corrects that mistake. The following compiles with the indicated message (previously this message was suppressed). 1. procedure ErrMsgDelete is 2.X : Integer;

[Ada] Placement of aspect/pragma SPARK_Mode

2013-09-10 Thread Arnaud Charlet
This patch modifies the processing of aspect/pragma SPARK_Mode to properly handle the cases where the aspect/pragma apply to a [library-level] package or subprogram [body]. -- Source -- -- func.ads function Func return Integer with SPARK_Mode => On; -- pack.adb pack

[Ada] Resolution of parameterless calls that return arrays

2013-09-10 Thread Arnaud Charlet
This patch handles properly additional constructs of the form F.all (I), where F is an access_to_function that can be called without parameters, and that returns an array type. Compiling err.adb must yield: err.adb:23:09: too many arguments in call to "A" err.adb:24:09: too many arguments in cal

[Ada] Constraints on class-wide types are ignored

2013-09-10 Thread Arnaud Charlet
A class-wide type has anonymous discriminants, because type extensions can add discriminants at will. A constraint on a class-wide type is thus a partial constraint that applies only to the known discriminants of the root type. Such a partial constraint is a language pathology that the ARG has dec

[Ada] Fixes in handling of spark code

2013-09-10 Thread Arnaud Charlet
This patch corrects the analysis of pragma SPARK_Mode to handle the case where the pragma appears without an argument. It also corrects the analysis of aspect/pragma Global to propery process an item that appears as a selected component and is later converted into an expanded name. Tested on x86_

[Ada] Ada 2012 Legality check on requeue statements

2012-10-01 Thread Arnaud Charlet
The target of a requeue statement on a protected entry must be a variable. This is part of AI05-0225, a binding interpretation that applies to all versions of the language. See ACATS test b954005.adb. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-01 Ed Schonberg * sem_ch9

[Ada] Validity checks on subprogram parameters and results

2012-10-01 Thread Arnaud Charlet
This patch introduces two new validity checks to the GNAT compiler: 1) -gnatVl Check non-overlapping parameters When this check is enabled, each subprogram call is preceded by a sequence of checks that ensure no overlap between actual parameters. 2) -gnatVv Check proper initialization of scal

[Ada] Handling of -vPx with incorrect x

2012-10-01 Thread Arnaud Charlet
Command line switch -vPx (set verbosity level for project file facility) in gnatmake and gnatcmd is is valid only for x=0, 1, or 2. This change ensures that any attempt to pass an invalid value generates a proper error message. The following commands must generate the indicated errors: $ gnat lis

[Ada] Detect more cases of possible infinite loops

2012-10-01 Thread Arnaud Charlet
In cases where GNAT did not detect the possibility of an infinite loop, it now issues a warning. For example, on the following code: $ gcc -c bad.adb bad.adb:9:13: warning: variable "Cur" is not modified in loop body bad.adb:9:13: warning: possible infinite loop 1. package body Bad is 2

[Ada] Ada 2012 legality checks on uses of names of protected procedures

2012-10-01 Thread Arnaud Charlet
Ada 2012 AI05-0225 clarifies that most uses of the names of protected procedures and entries require that the target object (explicit or implicit) be a variable. This applies to calls, generic actuals, and prefixes of 'Access. It applies in particular to such uses within the body a protected funct

[Ada] Tagged "/=" operator in GNAT tree doesn't get fully resolved with -gnatc

2012-10-01 Thread Arnaud Charlet
When an inequality operator is used for a tagged type, the tree node for the inequality prior to expansion (such as with -gnatc) reflects "/=" operator in Standard rather than being resolved to be a logical negation of the tagged type's equality function. This is a problem for ASIS in Corresponding

[Ada] Next step in implementing extended overflow checking

2012-10-01 Thread Arnaud Charlet
This patch defines the four modes of overflow handling (SUPPRESSED, CHECKED, MINIMIZED, ELIMINATED), and adds the Overflow_Checks pragma and extedned -gnato switch to et them. But for now Checked, Minimized, and Eliminated are all treated as Checked, so the behavior is unchanged. The following pro

[Ada] Set the flag In_Assertion_Expr during analysis of assertion expressions

2012-10-01 Thread Arnaud Charlet
In_Assertion_Expr should be non-zero during analysis of assertion expressions, even for preanalysis of these expressions. So wrap the call to Preanalyze_Spec_Expression to provide proper increment/decrement of the flag for assertion expressions. Tested on x86_64-pc-linux-gnu, committed on trunk 2

[Ada] Checks on aliasing and initialization of scalars for parameters

2012-10-01 Thread Arnaud Charlet
This patch reimplements the checks related to aliasing and initialization of scalars for subprogram parameters and ties them to compilation flags -gnateA and -gnateV respectively. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-01 Hristian Kirtchev * checks.adb (Apply_Parame

[Ada] Invariant checks and multiple inheritance

2012-10-01 Thread Arnaud Charlet
This patch fixes some problems involving the use of Type_Invariant'Class on the ancestor of a derived type that also implements an interface. The following command: gnatmake -q -gnat12 -gnata test_invariant test_invariant must yield: raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : fa

[Ada] Ada 2012 invariant checks on subcomponents

2012-10-01 Thread Arnaud Charlet
If a record has a subvomponent whose type has a defined invariant, then there must be a invariant check on that component whenever a value of the record type is created or modified by a visible primitive operation of the type. The command: gnatmake -q -gnat12 -gnata main main must yield:

[Ada] Additional invariant checks on composite types

2012-10-01 Thread Arnaud Charlet
If a composite type has a declared invariant, and some of its compoents are of types that have their own invariants, the invariant checks on those compoents must be added to the invariant checks for the enclosing type. The command; gnatmake -q -gnat12 -gnata test_bars test_bars must yield:

[Ada] Front-end support for per-instance coverage analysis

2012-10-01 Thread Arnaud Charlet
This changes adds circuitry to the front-end that allows the code generated for different instances of the same generic to be identified in debugging information. This will subsequently be used to allow per-instance coverage analysis. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-01

[Ada] Implement extended overflow handling for comparison ops

2012-10-01 Thread Arnaud Charlet
This patch enables extended overflow handling for comparison ops so that the comparison can be done in an expanded type, or even in bignum mode if operating in ELIMINATED overflow check mode. The following test program: 1. with Text_IO; use Text_IO; 2. procedure Overflowm2 is 3.

[Ada] Membership tests work with extended overflow checks

2012-10-01 Thread Arnaud Charlet
This patch implements membership tests in which the operands can be out of range in extended overflow checkig modes. The following is a test program: 1. pragma Ada_2012; 2. with Text_IO; use Text_IO; 3. procedure Overflowm3 is 4.subtype Int10 is Integer range 1 .. 5;

[Ada] Exponentiation works with extended overflow checks

2012-10-01 Thread Arnaud Charlet
This patch implements extended overflow checking modes with the exonentiation operator. The following is a test program: 1. with Text_IO; use Text_IO; 2. procedure Overflowm4 is 3.function r1 (a, b : Integer) return Boolean is 4.begin 5. return a ** 2 - b **

[Ada] Division/Rem/Mod work with extended overflow checks

2012-10-01 Thread Arnaud Charlet
This patch implements extended overflow checking modes with the division, rem, and mod operators. This completes the work on extended overflow checking. The following is a test program: 1. with Text_IO; use Text_IO; 2. procedure Overflowm5 is 3.function r1 (a, b, c : Integer)

[Ada] Static predicate checks on type conversions

2012-10-01 Thread Arnaud Charlet
In Ada 2012, if a subtype has predicates, a predicate check must be applied to the expression in a type conversion to the subtype. Furthermore, if the expression is a scalar static constant, the predicate must be evluated at compile-time, and the program must be rejected if the predicate is false.

[Ada] Complain when actual Symbol is present in any dimension output call

2012-10-01 Thread Arnaud Charlet
This patch prevents the user to provide parameter Symbol (reserved for compiler use only) in any dimension output call. -- Source -- with System.Dim.Mks;use System.Dim.Mks; with System.Dim.Mks_IO; use System.Dim.Mks_IO; procedure Main is begin Put (8.0**(1 / 3) *

[Ada] Avoid unnecessary use of Bignums for ELIMINATED mode

2012-10-02 Thread Arnaud Charlet
Previously there were cases where the result of an operator was converted to Bignum, only to be immediately converted back to Long_Long_Integer with an overflow check. This patch removes this unnecessary inefficiency. The following program: 1. procedure toplevov 2.(a : in out long_l

[Ada] Ada 2012 invariant checks on access values and components

2012-10-02 Thread Arnaud Charlet
This patch complete the generation of invariant checks, for the case of return values or in-out parameters that involve access types whose designated type has invariants. Executing: gnatmake -q -gnat12 -gnata main main must yield: 1 TEST 0 1 TEST 1 2 TEST 2 2 TEST 3 TEST 4 3 4

[Ada] Add extended overflow -gnato switch to usage

2012-10-02 Thread Arnaud Charlet
This patch adds documentation on the -gnato? and -gnato?? switches to the usage information. Documentation only, no functional effect but gnatmake output (with no switches) should have the following three lines for -gnato: -gnatoEnable overflow checking mode to CHECKED (off by default) -gn

[Ada] Warning for quantified expressions over null domains

2012-10-02 Thread Arnaud Charlet
A universal quantified expression over a null domain is True. This result will be counterintuitive for newcomers to Ada 2012, so it deserves an explicit warning. This patch also removes a spurious warning for such empty loops. The commands: gnatmake -q -gnat12 alfa alfa must yield: alfa.

[Ada] Indexing aspects and indexable containers

2012-10-02 Thread Arnaud Charlet
This patch refines several tests on the legality of indexing aspects: a) Constant_Indexing function do not have to return a reference type, b) given an indexing aspect Func, not all overloadings of Func in the current scope need to be indexing functions. The commnd: gnatmake -gnat12 -q main

[Ada] Project in limited withed chain reported as duplicate

2012-10-02 Thread Arnaud Charlet
This patch ensures that if a project is in a limited with import chain, it is not reported as a duplicate project. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-02 Vincent Celier * prj-part.adb (Post_Parse_Context_Clause): Resurrect Boolean parameter In_Limited. C

[Ada] Add style check for NOT IN

2012-10-02 Thread Arnaud Charlet
This patch adds a new style check for the layout of the NOT IN operation. If the token check style flag is set, then there must be exactly one space (and no other white space) between the NOT and the IN. The following is compiled with -gnaty: 1. package StyleNotIn is 2.x : Integer :=

[Ada] References to the formals of child subprograms without specs

2012-10-02 Thread Arnaud Charlet
If a child subprogram has no previous spec, treat a reference to its formals (such as a parameter association) as coming from source, in order to generate the proper references and enable gps navigation between reference and declaration. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-0

[Ada] Get rid of internal use of N_Return_Statement

2012-10-02 Thread Arnaud Charlet
This patch goes almost all the way in removing N_Return_Statement, and replacing it by N_Simple_Return_Statement. No test, since no functional effect. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-02 Robert Dewar * sinfo.adb, sinfo.ads, sem_util.adb, sem_util.ads, types.h,

[Ada] Ada/C++ missing call to constructor with defaults

2012-10-02 Thread Arnaud Charlet
When the type of an object is a CPP type and the object initialization requires calling its default C++ constructor, the Ada compiler did not generate the call to a C++ constructor which has all parameters with defaults (and hence it covers the default C++ constructor). The following test must now

[Ada] Small fixes to Eliminated overflow mode

2012-10-02 Thread Arnaud Charlet
This patch cleans up some documentation issues for eliminated mode, and fixes some errors for marginal cases. Not worth trying to concoct tests for these cases, which were found by code review, not from any reported bugs. Also forbid use of Eliminated mode if Long_Long_Integer'Size is not 64. Also

[Ada] Connect_Socket with timeout does not report failure correctly

2012-10-03 Thread Arnaud Charlet
This change fixes an oversight in the Connect_Socket variant that includes a timeout check. The connection is initiated asynchronously, and a select(2) call is performed to wait for it to complete, with a timeout. When that call returns however, the connection is not always succsefully established.

[Ada] Additional information on subtype conformance error

2012-10-03 Thread Arnaud Charlet
This patch adds a clarifying message info when subtype conformance fails, due to a missing null exclusion indicatar in a formal that must match a controlling access formal. This Ada 2005 rule was checked partially in the context of subprogram renamings but not for 'Access attribute references. Co

[Ada] Ada/C++ missing call to constructor with defaults

2012-10-03 Thread Arnaud Charlet
When the type of an object is a CPP untagged type and the object initialization requires calling its default C++ constructor, the Ada compiler did not generate the call to a C++ constructor which has all parameters with defaults (and hence it covers the default C++ constructor). // c_class.h class

[Ada] Ada/C++ missing call to allocation of C++ object with defaults

2012-10-03 Thread Arnaud Charlet
When the type of an object is a CPP untagged type, the object is allocated in memory through the "new" construct, and the object initialization requires calling its C++ constructor passing defaults, the Ada compiler did not generate the call to a C++ constructor which has all parameters with defaul

[Ada] Further fixes to MINIMIZED overflow checking mode

2012-10-03 Thread Arnaud Charlet
This patch has three components. First we set SUPPRESSED mode as the default for -gnatg mode (including the run-time). This has no effect right now, but avoids hidden problems that may appear if in future we make overflow checking the default behavior. Second, in some obscure cases, the overflow c

Fix -fdump-ada-spec

2012-10-04 Thread Arnaud Charlet
to -fdump-go-spec, and use regular switches via c/c.opt. I've removed the handling of TDF_RAW, which was a debugging option, and never really used, so can be simply deleted. Change is mostly trivial/mechanical. Tested on x86_64-pc-linux-gnu, OK for trunk? gcc/ 2012-10-04 Arnaud Ch

[Ada] Project_Dir should not modify the case of its path name

2012-10-04 Thread Arnaud Charlet
This patch ensures that when project'Project_Dir is used, the path will not be modified, even on platforms where the file names are case insensitive, such as Windows. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-04 Vincent Celier * prj-proc.adb (Process_Package_Declaratio

[Ada] Visibility error in the presence of private limited with clauses

2012-10-04 Thread Arnaud Charlet
This patch fixes a visibility error when compiling a unit DDP, when an ancestor P of DDP has a private limited with clause on a descendant of P that is itself an ancestor of DDP. The following must compile quietly: gcc -c -gnat05 bg-el-lc.adb --- package body BG.El.LC is overriding p

[Ada] Remaining fixes to get MINIMIZED through test suite

2012-10-04 Thread Arnaud Charlet
This patch makes two minor corrections to fix two remaining tests in the test suite that failed if run with -gnato2 forced on. There is also a minor optimization of Compile_Time_Compare which improves the results in some cases (noticed during testing, but does not have any effect on the test suite)

[Ada] Remaining fixes for -gnato3 (eliminated mode overflow checks)

2012-10-04 Thread Arnaud Charlet
This patch corrects a couple of errors in the handling of ELIMINATED mode overflow checking. With this patch, the entire test suite passes with -gnato3 mode forced on (there are some differences in output, but all are expected). The following three tests now work correctly The following compiles

[Ada] Legality of aspects specified on a full view

2012-10-04 Thread Arnaud Charlet
In Ada 2012, certain aaspects, such as Type_Invariant, can be specified on a partial view of a type, or on the full view, but not in both This patch rejects such duplications cleanly. the command: gcc -c -gnat12 -gnata r.ads must yield: r.ads:5:32: aspect already specified in private de

[Ada]: Remove __gl_zero_cost_exceptions in the binder generated file

2012-10-04 Thread Arnaud Charlet
This variable wasn't used anymore. No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-04 Tristan Gingold * init.c (__gl_zero_cost_exceptions): Comment it as not used anymore. * bindgen.adb (Gen_Adainit): Do not emit Zero_Cost_Exceptions

[Ada] New preprocessor switch -a

2012-10-04 Thread Arnaud Charlet
This change introduces a new switch "-a" (all source text preserved) for gnatprep and the integrated preprocessor, causing all source text to be preserved (i.e. the "if", all "elsif" and the "else" branch of a #if construct all show up in the output). This is useful to perform simple style checks o

[Ada] Warn on Ada 2012 set membership test duplicate element

2012-10-04 Thread Arnaud Charlet
This patch adds a warning if a duplicate literal entry is found in an Ada 2012 set membership, as shown by this example: 1. pragma Ada_2012; 2. package Dupset is 3.a : integer; 4.b : character; 5.c : boolean := a in 1 | 6.2 | 7

[Ada] Fix value of GNAT.Command_Line.Full_Switch on invalid switch

2012-10-04 Thread Arnaud Charlet
This patch fixes the value returned by Full_Switch when the user provided an invalid long switch (instead of return "--", Full_Switch will now return "--long"), as in this example: with GNAT.Command_Line; use GNAT.Command_Line; with Ada.Text_IO; use Ada.Text_IO; procedure Main is

[Ada] Missing deallocation of subpool

2012-10-05 Thread Arnaud Charlet
This patch ensures that Deallocate_Subpool is invoked on each subpool when the owner pool_with_subpools is finalized. -- Source -- -- gc_spool.ads with System.Storage_Pools.Subpools; private with System.Storage_Elements; package GC_SPool is use System; use Syste

[Ada] Fix race condition in freeing tasks

2012-10-05 Thread Arnaud Charlet
This patch fixes a subtle race condition where the master task and the child task may free the child task concurrently. Found by code reading. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-05 Arnaud Charlet * s-tassta.adb: Update comments

[Ada] Fix static computation of bounds using -gnato2 or -gnato3

2012-10-05 Thread Arnaud Charlet
The code for statically computing bounds for division and exponent was incorrect in some cases, possibly leading to wrong results when -gnato2 or -gnato3 was used. The code for mod and rem was not using optimal bounds, with possible minor consequences on efficiency of the generated code with -gnato

[Ada] Internal cleanup of overflow defaults

2012-10-05 Thread Arnaud Charlet
This patch changes the default overflow checking mode to suppressed in the case of targets that support backend divide and overflow checking as indicated by the appropriate flags in Targparm being set. There are no such targets currently, so this change has no effect and no test is needed. Tested

  1   2   3   4   5   6   7   8   9   10   >