[multiple changes]

2014-07-18  Robert Dewar  <dewar@adacore.com>

	* sem_ch13.adb (Is_Type_Ref): Check that type name is not
	parenthesized.

2014-07-18  Vincent Celier  <celier@adacore.com>

	* s-osinte-vms.ads: Fix style errors.

2014-07-18  Thomas Quinot  <quinot@adacore.com>

	* s-oscons-tmplt.c (_POSIX_SOURCE): Define in order to get
	NAME_MAX and PATH_MAX.

2014-07-18  Bob Duff  <duff@adacore.com>

	* exp_strm.adb (Build_Record_Or_Elementary_Input_Function,
	Build_Record_Or_Elementary_Output_Procedure): For Input and
	Output attributes, do not read/write the discriminants if they
	have default values; that will be done by Read/Write.

From-SVN: r212798
This commit is contained in:
Arnaud Charlet 2014-07-18 11:51:43 +02:00
parent 8ca597af97
commit 623267dc19
5 changed files with 50 additions and 16 deletions

View File

@ -1,3 +1,24 @@
2014-07-18 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb (Is_Type_Ref): Check that type name is not
parenthesized.
2014-07-18 Vincent Celier <celier@adacore.com>
* s-osinte-vms.ads: Fix style errors.
2014-07-18 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c (_POSIX_SOURCE): Define in order to get
NAME_MAX and PATH_MAX.
2014-07-18 Bob Duff <duff@adacore.com>
* exp_strm.adb (Build_Record_Or_Elementary_Input_Function,
Build_Record_Or_Elementary_Output_Procedure): For Input and
Output attributes, do not read/write the discriminants if they
have default values; that will be done by Read/Write.
2014-07-18 Robert Dewar <dewar@adacore.com>
* sem_aggr.adb, exp_ch5.adb, sem_ch3.adb, layout.adb, sem_type.adb,

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -1124,7 +1124,10 @@ package body Exp_Strm is
J := 1;
if Has_Discriminants (B_Typ) then
if Has_Discriminants (Typ)
and then
No (Discriminant_Default_Value (First_Discriminant (Typ)))
then
Discr := First_Discriminant (B_Typ);
-- If the prefix subtype is constrained, then retrieve the first
@ -1250,10 +1253,15 @@ package body Exp_Strm is
begin
Stms := New_List;
-- Note that of course there will be no discriminants for the
-- elementary type case, so Has_Discriminants will be False.
-- Note that of course there will be no discriminants for the elementary
-- type case, so Has_Discriminants will be False. Note that the
-- language rules do not require writing the discriminants in the
-- defaulted case, because those are written by 'Write.
if Has_Discriminants (Typ) then
if Has_Discriminants (Typ)
and then
No (Discriminant_Default_Value (First_Discriminant (Typ)))
then
Disc := First_Discriminant (Typ);
while Present (Disc) loop

View File

@ -80,9 +80,11 @@ pragma Style_Checks ("M32766");
/* Feature macro definitions */
/* Define _POSIX_SOURCE to get NAME_MAX, PATH_MAX */
#define _POSIX_SOURCE
#if defined (__linux__) && !defined (_XOPEN_SOURCE)
/** For Linux _XOPEN_SOURCE must be defined, otherwise IOV_MAX is not defined
**/
/* For Linux, define _XOPEN_SOURCE to get IOV_MAX */
#define _XOPEN_SOURCE 500
#endif

View File

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -496,7 +496,7 @@ package System.OS_Interface is
type struct_sched_param is record
sched_priority : int; -- scheduling priority
end record;
for struct_sched_param'Size use 8*4;
for struct_sched_param'Size use 8 * 4;
pragma Convention (C, struct_sched_param);
function pthread_setschedparam
@ -614,7 +614,7 @@ private
sequence : unsigned;
block : pthreadLongAddr_t_ptr;
end record;
for pthread_cond_t'Size use 8*32;
for pthread_cond_t'Size use 8 * 32;
pragma Convention (C, pthread_cond_t);
type pthread_attr_t is record
@ -623,7 +623,7 @@ private
arg : pthreadLongUint_t;
reserved : pthreadLongUint_array (0 .. 18);
end record;
for pthread_attr_t'Size use 8*176;
for pthread_attr_t'Size use 8 * 176;
pragma Convention (C, pthread_attr_t);
type pthread_mutex_t is record
@ -636,21 +636,21 @@ private
owner : unsigned;
depth : unsigned;
end record;
for pthread_mutex_t'Size use 8*40;
for pthread_mutex_t'Size use 8 * 40;
pragma Convention (C, pthread_mutex_t);
type pthread_mutexattr_t is record
valid : long;
reserved : pthreadLongUint_array (0 .. 14);
end record;
for pthread_mutexattr_t'Size use 8*128;
for pthread_mutexattr_t'Size use 8 * 128;
pragma Convention (C, pthread_mutexattr_t);
type pthread_condattr_t is record
valid : long;
reserved : pthreadLongUint_array (0 .. 12);
end record;
for pthread_condattr_t'Size use 8*112;
for pthread_condattr_t'Size use 8 * 112;
pragma Convention (C, pthread_condattr_t);
type pthread_key_t is new unsigned;

View File

@ -6247,7 +6247,8 @@ package body Sem_Ch13 is
pragma Inline (Is_Type_Ref);
-- Returns if True if N is a reference to the type for the predicate in
-- the expression (i.e. if it is an identifier whose Chars field matches
-- the Nam given in the call).
-- the Nam given in the call). N must not be parenthesized, if the type
-- name appears in parens, this routine will return False.
function Lo_Val (N : Node_Id) return Uint;
-- Given static expression or static range from a Static_Predicate list,
@ -6770,7 +6771,9 @@ package body Sem_Ch13 is
function Is_Type_Ref (N : Node_Id) return Boolean is
begin
return Nkind (N) = N_Identifier and then Chars (N) = Nam;
return Nkind (N) = N_Identifier
and then Chars (N) = Nam
and then Paren_Count (N) = 0;
end Is_Type_Ref;
------------