After further fiddling around, I found out the following:
_READ_WRITE_RETURN_TYPE gets resolved to int||long
from ChangeLog @ cygwin-1.7.2-2-src\cygwin-1.7.2-2\newlib\ChangeLog
2009-12-17 Jerker Back
* libc/include/_ansi.h: Add new _EXFNPTR macro for using with
function pointer arguments.
* libc/iconv/lib/conv.h: Use _EXFNPTR rather than _EXPARM macro.
* libc/iconv/lib/ucsconv.h: Ditto.
* libc/include/stdlib.h: Use new _EXFNPTR macro for function pointers.
* libc/include/sys/reent.h: Ditto.
_EXFNPTR introduced in 1.7.2-1
cygwin-1.7.2-2-src\cygwin-1.7.2-2\newlib\libc\include\_ansi.h
#define _EXFNPTR(name, proto) (__cdecl * name) proto
#define _EXFUN(name, proto) __cdecl name proto
Hence,
_READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, _PTR,
char *, int));
resolves to
int __cdecl * _read(struct _reent *, _PTR, char *, int)
and
_READ_WRITE_RETURN_TYPE _EXFUN((*_read),(struct _reent *, _PTR,
char *, int));
resolves to
int __cdecl (*_read)(struct _reent *, _PTR, char *, int))
So, both come out to be same. It will be nice to know if someone with
cygwin1.7.2+ version faced this issue and if so how did they resolve
it. Also, why is the ncc complaining about it?
On Sat, Sep 25, 2010 at 9:04 PM, Jatindera Walia
<[email protected]> wrote:
> Decided to upgrade my environment with clean/fresh install to latest
> version of cygwin (to 2.721 from 2.573.2.3) and tinyos ( to 2.1.1-3
> from 2.0.1 ) over the weekend and ran into a problem. The problem has
> been reported before but no resolution has been posted. I have found a
> workaround but not sure if it will be stable upon further
> investigation.
>
> Previously reported :
> http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2010-June/046846.html
>
> make micaz sim for Blink is leading to following error messages
> (partial output):
> ----------------------
>
> $ make micaz sim
> mkdir -p simbuild/micaz
> placing object files in simbuild/micaz
> writing XML schema to app.xml
> compiling BlinkAppC to object file sim.o
>
> ncc -c -DUSE_DL_IMPORT -fpic -o simbuild/micaz/sim.o -g -O0 -tossim
> -fnesc-nido -tosnodes=1000 -fnesc-simulate
> -fnesc-nido-motenumber=sim_node\(\) -fnesc-gcc=gc c -Wall -Wshadow
> -Wnesc-all -target=micaz -fnesc-cfile=simbuild/micaz/app.c -boa
> rd=micasb -DDEFINED_TOS_AM_GROUP=0x22 --param
> max-inline-insns-single=100000 -DI DENT_APPNAME=\"BlinkAppC\"
> -DIDENT_USERNAME=\"Jay\" -DIDENT_HOSTNAME=\"L001\" -D
> IDENT_USERHASH=0x6a310f07L -DIDENT_TIMESTAMP=0x4c9e9b65L
> -DIDENT_UIDHASH=0x44f33
> d94L -Wno-nesc-data-race BlinkAppC.nc -fnesc-dump=components
> -fnesc-dump=varia
> bles -fnesc-dump=constants -fnesc-dump=typedefs
> -fnesc-dump=interfacedefs -fnesc -dump=tags -fnesc-dumpfile=app.xml
>
> In file included from /usr/include/stdio.h:45,
> from /opt/tinyos-2.x/tos/lib/tossim/tos.h:45:
> /usr/include/sys/reent.h:185: syntax error before `('
>
> And so on .......
>
> ----------------------
>
> /usr/include/sys/reent.h has changed from older version of cygwin.
> Changes are given below:
> --------------------------------
> Old version line : 185
> _READ_WRITE_RETURN_TYPE _EXFUN((*_read),(struct _reent *, _PTR,
> char *, int));
>
> New version line : 185
> _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, _PTR,
> char *, int));
> --------------------------------
>
> Can the nesc & sim team look into issue? Is it a nesc compiler parsing
> bug? A hello world c program containing stdio.h compiles fine with
> gcc.
>
> Workaround :: Replacing the new version with old version of reent.h
> removes the compilation errors and sim runs fine. I cannot guarantee
> the stability as I am updating the .h file and the first parameter
> type is different. Hope this function doesn't get invoked otherwise
> trip to lala land is pretty much guaranteed.
>
> Thanks
> Jay
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help