This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


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

Regular expressions compile call.


I am working on a cygwin port from Linux. Straight forward, but one thing
puzzels me. Why is the regcomp call diffrent. I have to use this pice of
code to make it work on both platforms:

#ifdef cygwin
    regex_t *re;
#else
    regex_t a, *re;
    re = &a;
#endif

    i = regcomp(re, filter, REG_EXTENDED);

If I use a preallocated buffer in Cygwin i get an i = 269335288 = random.
Program gets unstable after the call. If I use a pointer it works.

On the linux box (Suse 7.0) I get a segmentation violation trying to run
with a pointer. Will run fine with a preallocated buffer. They are oposite
in behavior. What do I miss?

Oddvard


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


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