SQLRDD compilation error

237 views
Skip to first unread message

Jayadev

unread,
Sep 29, 2025, 6:24:38 AM (10 days ago) Sep 29
to Harbour Users
Hello,

Following the conversations on compiling SQLRDD for Harbour, I could build the lib file but I get the following warnings:

e:/ProjectWIP/xHarbour-SQLRDD/source/sqlact.c: In function 'quotedNull':
e:/ProjectWIP/xHarbour-SQLRDD/source/sqlact.c:1188:62: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
                sprintf( sValue, "TO_DATE(\'%s\',\'YYYYMMDD\')", sDate );
                                                              ^
e:/ProjectWIP/xHarbour-SQLRDD/source/sqlact.c:1188:16: note: 'sprintf' output between 23 and 31 bytes into a destination of size 30
                sprintf( sValue, "TO_DATE(\'%s\',\'YYYYMMDD\')", sDate );
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
e:/ProjectWIP/xHarbour-SQLRDD/source/sqlsrodbc.c: In function 'odbcGetData':
e:/ProjectWIP/xHarbour-SQLRDD/source/sqlsrodbc.c:1334:23: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
                   "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
                    ~~~^
                    %08lx
                   buffer.Data1, buffer.Data2, buffer.Data3,
                   ~~~~~~~~~~~~
e:/ProjectWIP/xHarbour-SQLRDD/source/sqlsrodbc.c:1334:23: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
                   "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
                    ~~~^
                    %08lx
                   buffer.Data1, buffer.Data2, buffer.Data3,
                   ~~~~~~~~~~~~

Will the SqlRdd lib work with these warnings or how to pacify these warnings ?

Best,

Jayadev

arielso...@gmail.com

unread,
Sep 29, 2025, 10:20:15 AM (10 days ago) Sep 29
to harbou...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/57cc4357-627a-4697-84b4-7a0664e8d4ccn%40googlegroups.com.

Jayadev U

unread,
Sep 30, 2025, 12:05:02 AM (9 days ago) Sep 30
to harbou...@googlegroups.com

Hi Marcos,

 

Thanks so much, will download, compile and let you know.

 

Best,

 

Jayadev

Jayadev U

unread,
Sep 30, 2025, 12:45:23 AM (9 days ago) Sep 30
to harbou...@googlegroups.com

Hi Marcos,

 

I since downloaded the code and tried to compile and get the following error message:

 

source\sqlconnection.prg(330) Error E0055  CASE requires either numeric or string constant

source\sqlconnection.prg(331) Error E0055  CASE requires either numeric or string constant

source\sqlconnection.prg(802) Warning W0001  Ambiguous reference 'SYSTEMID_FIREBR5'

source\sqlconnection.prg(804) Warning W0001  Ambiguous reference 'SYSTEMID_FIREBR4'

source\sqlconnection.prg(1242) Warning W0001  Ambiguous reference 'SYSTEMID_FIREBR4'

source\sqlconnection.prg(1242) Warning W0001  Ambiguous reference 'SYSTEMID_FIREBR5'

2 errors

 

No code generated.

 

Could you please check.  I have tried to compile under Harbour 3.2-latest nightly build.

 

Best,

 

Jayadev

 

From: harbou...@googlegroups.com <harbou...@googlegroups.com> On Behalf Of arielso...@gmail.com
Sent: 29 September 2025 07:50 PM
To: harbou...@googlegroups.com
Subject: RE: [harbour-users] SQLRDD compilation error

 

Hi, try

Jayadev U

unread,
Oct 1, 2025, 12:14:34 AM (8 days ago) Oct 1
to harbou...@googlegroups.com

Hi Marcos,

Thanks for your support.

 

I have corrected the errors, basically, hbmk2 was using Sqlrdd.ch from the default folder and could not find FIREBR4 and FIREBR5 in that.

 

However, now the following warnings have cropped up on compilation:

 

e:\sqlrddpp>hbmk2 sqlrddpp.hbp

hbmk2: Compiling...

../../../../../../source/sqlsrodbc.c: In function 'odbcFieldGet':

../../../../../../source/sqlsrodbc.c:458:72: warning: operand of ?: changes signedness from 'HB_ISIZ' {aka 'long int'} to 'HB_SIZE' {aka 'long unsigned int'} due to unsignedness of other operand [-Wsign-compare]

       hb_xmemcpy(szResult, bBuffer, ((HB_ISIZ)lLen < lLenBuff ? lLen : lLenBuff));

                                                                        ^~~~~~~~

hbmk2: Creating static library... lib\win\mingw\libsqlrddpp.a

 

Will this have any problem in the smooth functioning of the lib ?

 

Best,

 

Jayadev

 

 

From: Jayadev U <ujay...@gmail.com>
Sent: 30 September 2025 10:15 AM
To: 'harbou...@googlegroups.com' <harbou...@googlegroups.com>
Subject: RE: [harbour-users] SQLRDD compilation error

 

Hi Marcos,

 

I since downloaded the code and tried to compile and get the following error message:

 

source\sqlconnection.prg(330) Error E0055  CASE requires either numeric or string constant

source\sqlconnection.prg(331) Error E0055  CASE requires either numeric or string constant

source\sqlconnection.prg(802) Warning W0001  Ambiguous reference 'SYSTEMID_FIREBR5'

source\sqlconnection.prg(804) Warning W0001  Ambiguous reference 'SYSTEMID_FIREBR4'

source\sqlconnection.prg(1242) Warning W0001  Ambiguous reference 'SYSTEMID_FIREBR4'

source\sqlconnection.prg(1242) Warning W0001  Ambiguous reference 'SYSTEMID_FIREBR5'

2 errors

 

No code generated.

 

Could you please check.  I have tried to compile under Harbour 3.2-latest nightly build.

 

Best,

 

Jayadev

 

From: harbou...@googlegroups.com <harbou...@googlegroups.com> On Behalf Of arielso...@gmail.com
Sent: 29 September 2025 07:50 PM
To: harbou...@googlegroups.com
Subject: RE: [harbour-users] SQLRDD compilation error

 

Hi, try

ivanil.m...@gmail.com

unread,
Oct 2, 2025, 2:37:47 PM (7 days ago) Oct 2
to Harbour Users
D:\Prgplus\Git\lib2025\sqlrddpp>rem hbmk2 -workdir=.\obj\32  -exitstr -info -trace -q -gc3 -map -p.\ppo\ sqlrdd.hbp

D:\Prgplus\Git\lib2025\sqlrddpp>hbmk2 -workdir=.\obj\32bcc -exitstr -D__BORLANDC__  -D__WIN32__ -DWIN32 -DPROTOTYPES -info -trace -q -map -p.\ppo\ sqlrdd.hbp
hbmk2: Processing environment options: -comp=bcc
hbmk2: Auto-detected platform: win
hbmk2: Compiling...
hbmk2: C/C++ compiler command:
bcc32.exe -c -q -CP437 -d -O2 -OS -Ov -Oc -Oi -6  -tWM -w -Q -w-sig -nobj\32bcc -IS:\Mega\Dev\Borland\Bcc582\Include -IS:\Mega\Dev\Borland\Bcc582\Include\dinkumware -ID:\Prgplus\Git\lib2025\IDE\BCC\tools\harbour\include -Iinclude -Iinclude\firebird -Iinclude\mysql -Iinclude\oci -Iinclude\pgsql -Isource source\mysql.c source\pgs.c
source\mysql.c:
Error E2140 source\mysql.c 667: Declaration is not allowed here in function HB_FUN_MYSQUERYATTR
Error E2140 source\mysql.c 668: Declaration is not allowed here in function HB_FUN_MYSQUERYATTR
Error E2140 source\mysql.c 674: Declaration is not allowed here in function HB_FUN_MYSQUERYATTR
Error E2140 source\mysql.c 819: Declaration is not allowed here in function HB_FUN_MYSTABLEATTR
Error E2140 source\mysql.c 820: Declaration is not allowed here in function HB_FUN_MYSTABLEATTR
Error E2140 source\mysql.c 826: Declaration is not allowed here in function HB_FUN_MYSTABLEATTR
*** 6 errors in Compile ***
source\pgs.c:
Error E2140 source\pgs.c 381: Declaration is not allowed here in function HB_FUN_PGSQUERYATTR
*** 1 errors in Compile ***
hbmk2[sqlrdd]: Error: Running C/C++ compiler. 1
bcc32.exe -c -q -CP437 -d -O2 -OS -Ov -Oc -Oi -6  -tWM -w -Q -w-sig -nobj\32bcc -IS:\Mega\Dev\Borland\Bcc582\Include -IS:\Mega\Dev\Borland\Bcc582\Include\dinkumware -ID:\Prgplus\Git\lib2025\IDE\BCC\tools\harbour\include -Iinclude -Iinclude\firebird -Iinclude\mysql -Iinclude\oci -Iinclude\pgsql -Isource source\mysql.c source\pgs.c
hbmk2[sqlrdd]: Exit status: 6: failed in compilation (Harbour, C compiler, Resource compiler)

+++++++++
source\pgs.c:
Error E2140 source\pgs.c 381: Declaration is not allowed here in function HB_FUN_PGSQUERYATTR
*** 1 errors in Compile ***
hbmk2[sqlrdd]: Error: Running C/C++ compiler. 1

Nota:
To be able to compile with Borland 5.8, I had to move the variable declarations to the beginning of the function; the error does not occur in mingw;

Reply all
Reply to author
Forward
0 new messages