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]
Other format: [Raw text]

Using -mno-cygwin


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: wdale@ozemail.com.au
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/


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