Liste des Groupes | Revenir à co vms |
On 6/6/2025 8:54 AM, Craig A. Berry wrote:Nor why the detection code doesn't correctly identify that vasprintf is
> On 6/5/25 8:35 PM, Arne Vajhøj wrote:
>> On 6/5/2025 5:16 PM, Craig A. Berry wrote:
>>> On 6/5/25 12:33 PM, Simon Clubley wrote:
>>>> On 2025-06-05, Arne Vajhøj <arne@vajhoej.dk> wrote:
>>>>> And DBLIB.C contains:
>>>>>
>>>>> RETCODE
>>>>> dbfcmd(DBPROCESS * dbproc, const char *fmt, ...)
>>>>> {
>>>>> va_start(ap, fmt);
>>>>> len = vasprintf(&s, fmt, ap);
>>>>> va_end(ap);
>> It is vasprintf that return -1.
>>
>> It happens with both normal build and /DEB/NOOPT.
>> I created a standalone example doing the same just without any FreeTDS.
>>
>> It works fine.
>> I must be missing something.
>
> Check for the line in your generated descrip.mms that starts with:
>
> VASPRINTFOBJ =
>
> If the right-hand side is empty, you are using the system-supplied
> vasprintf, which is what should happen. If it's not empty, you are
> getting a replacement vasprintf() from FreeTDS, which in turn means the
> detection code in configure.com is not working right (unless you are on
> a version of VMS before vasprintf() was added to the CRTL). Either
> should work in principle, but it could be one difference between your
> standalone test and your FreeTDS test.
Bingo.
$ diff descrip.mms
************
File DKA0:[arne.freetds.freetds-1_5_2]descrip.mms;2
149 VASPRINTFOBJ =
150 STRTOK_ROBJ =
******
File DKA0:[arne.freetds.freetds-1_5_2]descrip.mms;1
149 VASPRINTFOBJ = [.src.replacements]vasprintf$(OBJ),
150 STRTOK_ROBJ =
************
$ diff [.include]config.h
************
File DKA0:[arne.freetds.freetds-1_5_2.include]config.h;2
234 #define HAVE_VASPRINTF 1
235
******
File DKA0:[arne.freetds.freetds-1_5_2.include]config.h;1
234 #define HAVE_VASPRINTF 0
235
************
And now dbfcmd works.
Of course it does not explain why the replacement doesn't work.
Les messages affichés proviennent d'usenet.