Liste des Groupes | Revenir à co vms |
On 6/5/2025 5:16 PM, Craig A. Berry wrote:Check for the line in your generated descrip.mms that starts with:On 6/5/25 12:33 PM, Simon Clubley wrote:On 2025-06-05, Arne Vajhøj <arne@vajhoej.dk> wrote:Mysterious.
>
stat = dbfcmd(con, "INSERT INTO t1 VALUES(%d, '%s')", f1, f2esc);
>
fails.
>
char buf[1000];
sprintf(buf, "INSERT INTO t1 VALUES(%d, '%s')", f1, f2esc);
stat = dbcmd(con, buf);
>
works.
>
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.Does this _exact_ code work on Alpha ?>
>
If yes, try building your test code with compiler optimisation disabled.
>
If that doesn't work, try building the library itself with compiler
optimisation disabled.
>
$ mmk clean
$ @[.vms]configure
$ mmk/MACRO=__DEBUG__=1
>
It happens with both normal build and /DEB/NOOPT.
I have not tried on Alpha yet.
There are just a few %CC-I-QUESTCOMPARE.Any compiler build warnings either in the library or your test code ?
(Try setting warnings to fatal to abort the build if you get a lot of
output during building).
It is a mystery.I am trying to eliminate the possibility you may have stumbled across
a compiler bug.
I have a query that use dbfcmd and it works. But it fails for
my updates.
I created a standalone example doing the same just without any FreeTDS.
It works fine.
$ typ z.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
void dbfcmd(void *dbproc, const char *fmt, ...)
{
va_list ap;
char *s;
int len;
va_start(ap, fmt);
len = vasprintf(&s, fmt, ap);
va_end(ap);
printf("len=%d s=|%s|\n", len, s);
free(s);
}
int main()
{
dbfcmd(NULL, "INSERT INTO t1 VALUES(%d, '%s')", 999, "XXX");
dbfcmd(NULL, "INSERT INTO t1 VALUES(%d, '%s')", 999, "XXX");
dbfcmd(NULL, "INSERT INTO t1 VALUES(%d, '%s')", 999, "XXXXXX");
return 0;
}
$ r z
len=33 s=|INSERT INTO t1 VALUES(999, 'XXX')|
len=33 s=|INSERT INTO t1 VALUES(999, 'XXX')|
len=36 s=|INSERT INTO t1 VALUES(999, 'XXXXXX')|
I must be missing something.
Les messages affichés proviennent d'usenet.