delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/18/10:34:18

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 18 Aug 2011 16:33:29 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: v*printf functions not available with g++ -std=c++0x
Message-ID: <20110818143329.GQ27614@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4E4BD899 DOT 4070409 AT cs DOT utoronto DOT ca>
MIME-Version: 1.0
In-Reply-To: <4E4BD899.4070409@cs.utoronto.ca>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Aug 17 11:04, Ryan Johnson wrote:
> Hi all,
> 
> I'm using the experimental gcc-4.5 package and hit a strange error:
> c++0x mode suppresses the definition of the v*printf() family of
> functions in stdio.h in c++0x mode. The offending code seems to be:
> 
> #if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L)
> #ifndef _REENT_ONLY
> ...
> int     _EXFUN(vsnprintf, (char *, size_t, const char *, __VALIST)
>                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
> ...
> #endif
> #endif
> 
> Running `g++ -std=c++0x -dM -E' indicates that __STRICT_ANSI__  is
> defined while _REENT_ONLY and __STDC_VERSION__ are not.
> 
> Oddly, functions like _vsnprintf_r are still available for some
> strange reason (aren't they extensions?). I hope this is a bug
> rather than a requirement of the new standard; meanwhile, using
> std=gnu++0x works around the problem.

If I try that with Yaakov's 4.5.3 cross compilers, then __STRICT_ANSI__
is not defined with -std=c__0x, unless I also specify `-ansi' on the
command line.  However, there's a weird warning:

  $ i686-pc-cygwin-g++ -std=c++0x -dM -E - < /dev/null | grep ANSI
  cc1: warning: command line option "-std=c++0x" is valid for C++/ObjC++ but not for C

Well, sure, that's why I called g++, not gcc...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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