[Rd] Effect of the R framework on ctype.c

From: Sylvain Loiseau <sylvain.loiseau_at_univ-paris13.fr>
Date: Mon, 08 Oct 2012 16:11:48 +0200


ink1">ink1">Dear all,

I'm facing a strange behavior in the the C code of a R package. This package, "rcqp", is a wrapper on an existing program that I did not write, "CWB".

In this package, on a linux (ubuntu and debian) system, the code :

     printf(%d\n", isupper('A'));
outputs :

    0
When compiled with the R framework (It behaves correctly when CWB is compiled as a standalone program).

On mac osx, the code produce the expected output.

This unexpected output is observed only in the context of CWB compiled through rcqp, only on linux (not mac osx), and only under certains circumstances, since a minimal R package produce the expected output. Even in CWB, this strange behavior is not observed in any part of the code.

When observed, a work-around for this problem is to remove the include in which this very function, isupper, is defined:

    #include <ctype.h>

Since the program is compiled and run correctly without this "include", isupper() seems to be also declared elsewhere or ctype to be found by another mechanism, and the problem seems be due to interactions between the R headers (?) and the include of the CWB code…

Have you already observed such an effect or do you have any hint? Best,
Sylvain



Sylvain Loiseau
sylvain.loiseau_at_univ-paris13.fr

Université Paris 13-Nord
Laboratoire Lexiques, Dictionnaires, Informatique (UMR 7187 CNRS/Université Paris 13-Nord) 99 avenue Jean-Baptiste Clément

F-93410 Villetaneuse



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 08 Oct 2012 - 14:13:45 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 08 Oct 2012 - 15:30:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive