delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2013/04/03/18:00:23

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Authentication-Results: msg-ip1.usc.edu; dkim=neutral (message not signed) header.i=none
X-IronPort-AV: E=Sophos;i="4.87,403,1363158000";
d="scan'208";a="769245833"
Date: Wed, 03 Apr 2013 14:59:44 -0800
From: Mikhail Ryazanov <ryazanov AT usc DOT edu>
Subject: Re: snprintf not found
In-reply-to: <83ehesib96.fsf@gnu.org>
Sender: ryazanov AT usc DOT edu
To: djgpp AT delorie DOT com
Message-id: <515CB460.9030509@usc.edu>
Organization: USC
MIME-version: 1.0
References: <515B8EE7 DOT 4060603 AT usc DOT edu> <83ehesib96 DOT fsf AT gnu DOT org>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107
Thunderbird/17.0.2
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 02.04.2013 18:44, Eli Zaretskii wrote:
>> Date: Tue, 02 Apr 2013 18:07:35 -0800
>> From: Mikhail Ryazanov <ryazanov AT usc DOT edu>
>>
>> I have a problem compiling programs with snprintf (actually, vsnprintf)
>> function. Although it is described in the documentation
>> [http://www.delorie.com/djgpp/doc/libc/libc_732.html] and is present in
>> the provided header files, a simple test program
...
>> fails to compile both in C++ mode:
>>
>> ... error: 'snprintf' was not declared in this scope
>>
>> (playing with <cstdio> and various possible scopes does not help) and in C:
...
>
> snprintf is only available in (yet unreleased) version v2.04 of the
> library.  Are you using that, or do you have v2.03 installed?  If the
> latter, then indeed there's no snprintf.

Thanks for the explanation!
I have v2.03, as zip-picker suggested. How usable is v2.04 now?

>> I found a probably related discussion at
>> [http://cygwin.com/ml/cygwin/2012-04/msg00140.html] (about one year
>> ago), but it seems that there the problem was only for particular
>> "-std=" choices, whereas current DJGPP fails with _any_ kind of C/C++
>> standard (including "gnu...").
>
> Cygwin is not related to DJGPP.

Well, their problem was in conditionals in header files, so I guessed 
that this might be related, since, as I said above, snprintf _is_ 
declared (also inside some conditional) in cstdio from gpp472b.zip that 
I am using.

>> P.S. For comparison, gcc 4.6.1 in Debian works fine.
> GCC version has nothing to do with this.  Standard functions are
> implemented in the library, not in the compiler.

I understand, but they must be not only implemented in the library, but 
also declared in library header files, which in turn have some 
correlation with the compiler. At least, "4.72" in the path

DJGPP/include/cxx/4.72/cstdio

suspiciously resembles "4.7.2" in the output of
"DJGPP/bin/gcc.exe --version". ;-)


So, back to v2.03/v2.04. Currently the problem in C++ occurs even before 
that linker cannot find snprintf in the library -- the compiler simply 
does not see its declaration. If I replace djdev203 with djdev204, will 
it start seeing? Or I need to update gpp as well?

-- 
Best regards,
Mikhail Ryazanov

- Raw text -


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