This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, libgfortran] PR53445/53444 - Fix compilation on VxWorks

On Tue, May 22, 2012 at 5:57 PM, Tobias Burnus <> wrote:
> On 05/22/2012 03:06 PM, Tobias Burnus wrote:
>> The attached patches fix compilation issues on VxWorks.
>> a) VxWorks has strerror_r but contrary to POSIX, the function in VxWorks
>> (at least in older versions) takes only two arguments: errnum and buf and
>> not also the buffer length. I added a configure check for that variant.
> I forgot to attach that patch. Now with patch and automake 1.11.1 for the
> generated files.
> Tobias

For the a) patch (strerror_r): The diff occurs twice in
the patch, and the patch file has DOS line endings. Also, based on
some googling the vxworks 2-arg strerror_r returns OK or ERROR (an
enum, I presume). So the trick with builtin_choose_expr is both wrong
and unnecessary. Thus I'd replace

+#elif defined(HAVE_STRERROR_R_2ARGS)
+  return
+    __builtin_choose_expr (__builtin_classify_type (strerror_r (0, buf))
+			   == 5,
+			   /* char*-returning strerror_r()  */
+			   strerror_r (errnum, buf),
+			   /* int-returning strerror_r ()  */
+			   (strerror_r (errnum, buf), buf));


#elif defined(HAVE_STRERROR_R_2ARGS)
if (strerror_r (errnum, buf) == OK)
  return buf;
return NULL;

Otherwise Ok.

For the b) patch (sticky bit): Also DOS line endings. If the patch is
verbatim by the OP it would perhaps be nice to include his name in the
ChangeLog as well (it's small enough that AFAICS it goes below the
trivial limit, thus no requirement for copyright assignment etc.).
Otherwise Ok.

Thanks for the patches!

Janne Blomqvist

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]