Deutsch   English   Français   Italiano  
<101v0s2$29494$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk>
Newsgroups: comp.os.vms
Subject: Re: FreeTDS port to VMS V9.x on x86?
Date: Fri, 6 Jun 2025 11:18:27 -0400
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <101v0s2$29494$2@dont-email.me>
References: <101n7gq$4m9b$1@dont-email.me>
 <683f3086$0$693$14726298@news.sunsite.dk> <101ncau$57on$1@dont-email.me>
 <101nqij$9edo$1@dont-email.me> <101sb4a$1ioac$1@dont-email.me>
 <101shm9$1l3ag$1@dont-email.me> <101skdr$1lvhe$1@dont-email.me>
 <101t1fh$1op7a$1@dont-email.me> <101tglm$1s66m$1@dont-email.me>
 <101uodt$28rq1$1@dont-email.me> <101uuno$29494$1@dont-email.me>
 <101v0kt$2at4q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 06 Jun 2025 17:18:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b06f16a07aabe3ee83066c8d1cafe663";
	logging-data="2396452"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18TeqGHNIy5GjmT+xQ0D6Ct43urxqlaF3M="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:YbmqahM5KaOfdqJlAUOuJoS8IMk=
Content-Language: en-US
In-Reply-To: <101v0kt$2at4q$1@dont-email.me>
Bytes: 2926

On 6/6/2025 11:14 AM, Craig A. Berry wrote:
> On 6/6/25 9:42 AM, Arne Vajhøj wrote:
>> And now dbfcmd works.
>>
>> Of course it does not explain why the replacement doesn't work.
> 
> Nor why the detection code doesn't correctly identify that vasprintf is
> present.  That detection code has been there unchanged for 23 years:
> 
> https://github.com/FreeTDS/freetds/blob/ 
> a381342bbfccafc0aa9ed2376e38470907d53225/vms/configure.com#L267
> 
> #include <stdarg.h>
> #include <stdio.h>
> #include <stdlib.h>
> int main()
> {
> char *ptr;
> vasprintf(&ptr,"%d,%d",1,2);
> exit(0);
> }
> 
> But it isn't using va_start/va_end, which it surely should. My guess is
> this worked by accident on pre-x86 but something tightened up on x86
> that makes the vasprintf call fail and causes FreeTDS to use its
> fallback implementation.  I'm without access at the moment so can't test
> this theory out myself.

I can confirm that.

On x86-64:

$ typ zzz.c
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *ptr;
vasprintf(&ptr,"%d,%d",1,2);
exit(0);
}
$ cc zzz

vasprintf(&ptr,"%d,%d",1,2);
........................^
%CC-W-CVTDIFTYPES, In this statement, "1" of type "int", is being 
converted to "long pointer to char".
at line number 7 in file DKA0:[arne.freetds]zzz.c;1

vasprintf(&ptr,"%d,%d",1,2);
^
%CC-E-TOOMANYARGS, In this statement, "vasprintf" expects 3 arguments, 
but 4 are supplied.
at line number 7 in file DKA0:[arne.freetds]zzz.c;1

Arne