delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/22/08:15:26

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=BAYES_00,RCVD_NUMERIC_HELO,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Oleksandr Gavenko <gavenko AT bifit DOT com DOT ua>
Subject: __STRICT_ANSI__ with -std=c99
Date: Mon, 22 Mar 2010 15:03:33 +0200
Lines: 40
Message-ID: <ho7prb$vj9$1@dough.gmane.org>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

My code use strupr func which is defined in string.h.

But with

   $ gcc -std=c99 -c -o grid.o grid.c

I got

grid.c:236: warning: implicit declaration of function 'strupr'.

This is because with -std=c99 gcc define __STRICT_ANSI__:

   $ gcc -std=c99 -dM -E - < /dev/null | grep __STRICT_ANSI__
   #define __STRICT_ANSI__ 1

As say gcc.info __STRICT_ANSI__ is defined if -ansi pass to gcc.
There are no info for -std=c99 option.

This issue many time discussed previously, just google about
"__STRICT_ANSI__ cygwin".

Some patches for math.h done.
I use func that in newlib and not in POSIX/ANSI
but strdup and another funcs in POSIX and also affected.

 From string.h:

#ifndef __STRICT_ANSI__
...
char 	*_EXFUN(strdup,(const char *));
char	*_EXFUN(strupr,(char *));
...
#endif

Current workaround is undefine __STRICT_ANSI__:

   $ gcc -std=c99 -U__STRICT_ANSI__ -c -o grid.o grid.c


Where is proper place to report issue?


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019