Using -mno-cygwin

2002-11-28 Thread Warren Dale
I am a happy Cygwin user.
I am trying to convert a program so that it will be Cygwin independent.
I have struck two problems:

--

(1) The program compiles and links clean, but is unable to use printf() to 
display a long long variable.
$ cat test1.c
#include stdio.h

int main(void)
{
long long number = 123456789012;

printf(%lld\n, number);
return(0);
}

$ gcc -Wall -Wshadow test1.c -s -o test1
$ ./test1
123456789012
$ gcc -Wall -Wshadow -mno-cygwin test1.c -s -o test1
$ ./test1
-1097262572
$

QUESTION 1: Should long long be fully supported in mingw32?
It seems that the compiler and the library do not agree.

--

(2) A program using snprintf() compiles clean, but cannot link.
$ cat test2.c
#include stdio.h

int main(void)
{
char buffer[20];
long number = 12345678;

snprintf(buffer, sizeof(buffer), %lld\n, number);
return(0);
}
$ gcc -Wall -Wshadow test2.c -s -o test2
{no errors}
$ gcc -Wall -Wshadow -mno-cygwin test2.c -s -o test2
/cygdrive/c/WINDOWS/TEMP/ccaayW3m.o(.text+0x2a):test2.c: undefined 
reference to `snprintf'
collect2: ld returned 1 exit status
$

QUESTION 2: Should snprintf() be fully supported in mingw32?
It seems that the compiler and the library do not agree.

--

In both cases I can code around the limitations if I have to.

Regards,
Warren.


Warren Dale
Email: [EMAIL PROTECTED]
Mobile: 0412-700-966
Home: (02) 9482-8552



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



The gcc compile flag -mwin32 _WIN32

2002-11-11 Thread Warren Dale
At 06:27 11/11/2002, Tim Prince wrote:

The cygwin-specific gcc compile flag -mwin32 causes the _WIN32 macro to be
defined. Certain cygwin applications predate that arrangement, so confusion
is understandable.


Where can I can find documentation on -mwin32?

Warren.

Warren Dale
Email: [EMAIL PROTECTED]
Mobile: 0412-700-966
Home: (02) 9482-8552



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/