+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.
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
else
return Cannot_Resolve_Error;
end if;
+ pragma Warnings (On);
+
end Resolve_Error;
-----------------------