diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2010-09-30 16:01:30 +0000 |
---|---|---|
committer | Joel Sherrill <joel@gcc.gnu.org> | 2010-09-30 16:01:30 +0000 |
commit | 0eeccfa3ff890e75c4db2375262c2484de62f475 (patch) | |
tree | 479526e1f6308571599b43325ef02260e50d9ba1 | |
parent | ca01d012be40cb9bc09d0c4aa7af4b0a74c75b9f (diff) | |
download | gcc-0eeccfa3ff890e75c4db2375262c2484de62f475.zip gcc-0eeccfa3ff890e75c4db2375262c2484de62f475.tar.gz gcc-0eeccfa3ff890e75c4db2375262c2484de62f475.tar.bz2 |
g-socket.adb: Move pragma to disable warnings in case multiple errnos are not defined by target.
2010-09-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* g-socket.adb: Move pragma to disable warnings in case
multiple errnos are not defined by target.
From-SVN: r164753
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/g-socket.adb | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e585924..52be3a9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2010-09-28 Joel Sherrill <joel.sherrill@oarcorp.com> + + * g-socket.adb: Move pragma to disable warnings in case + multiple errnos are not defined by target. + 2010-09-29 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/utils.c (handle_leaf_attribute): Fix long line. diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index b75c525..65bfdd5 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -1821,12 +1821,14 @@ package body GNAT.Sockets is return Resource_Temporarily_Unavailable; end if; - pragma Warnings (On); - -- This is not a case statement because if a particular error -- number constant is not defined, s-oscons-tmplt.c defines -- it to -1. If multiple constants are not defined, they -- would each be -1 and result in a "duplicate value in case" error. + -- + -- But we have to leave warnings off because the compiler is also + -- smart enough to note that when two errnos have the same value, + -- the second if condition is useless. if Error_Value = ENOERROR then return Success; elsif Error_Value = EACCES then @@ -1910,6 +1912,8 @@ package body GNAT.Sockets is else return Cannot_Resolve_Error; end if; + pragma Warnings (On); + end Resolve_Error; ----------------------- |