harbour / core

Portable, xBase compatible programming language and environment
https://harbour.github.io/
Other
324 stars 207 forks source link

Fixed some conversion errors #352

Closed EMG60 closed 10 months ago

EMG60 commented 10 months ago

Fixed some conversion errors

tuffnatty commented 10 months ago

Hi @EMG60,

  1. Your ChangeLog entry mentions nonexistent paths.
  2. It's not clear what you're trying to fix and on what platform, the strict CI builds don't produce any warnings in these places. I generally support fixing my code (contrib/hbsqlit3/core.c), but I would probably introduce an extra variable instead of repeating const char * twice, and I would like to be able to reproduce the warning/error here, which our CI builds do not show at the moment.
  3. Also, my experience tells me that adding a commit including both core and contrib changes, or two different contribs, should be discouraged as the Git history is harder to grok then, and cherry-picking individual changes is harder. Yours are separate commits, but would have to be squash-merged by a committer, if one decides to merge them.
EMG60 commented 10 months ago
  1. Sorry, only a typo: contrib/hbsqlit3/core.c
  2. I get the conversion errors using Microsoft C++ 2022 32-bit
  3. Do you want me to split the two commits? I can do it, no problem. Please confirm.
EMG60 commented 10 months ago

Please note: they are errors which prevent building Harbour with Microsoft C++ 2022.

EMG60 commented 10 months ago
  1. Sorry, only a typo: contrib/hbsqlit3/core.c

Fixed.

EMG60 commented 10 months ago

This is a reduced sample of the problem:

void test( const unsigned char *p ) { ( void ) p; }

int main() { const unsigned char *p = 1;

test( p );

return 0;

}

EMG60 commented 10 months ago

Please, let me know what I have to do to get my pull request committed,

EMG60 commented 10 months ago

This is the error I get with MSC32 and current repository:

..\contrib\hbssl\rsa.c(117): error C2664: 'int RSA_public_encrypt(int,const unsigned char ,unsigned char ,RSA ,int)': cannot convert argument 2 from 'void ' to 'const unsigned char ' ..\contrib\hbssl\rsa.c(117): note: Conversion from 'void' to pointer to non-'void' requires an explicit cast e:\hrbbld\openssl\x86\include\openssl/rsa.h(288): note: see declaration of 'RSA_public_encrypt' (compiling source file ..\contrib\hbssl\rsa.c)

EMG60 commented 10 months ago

Many thanks to Przemek for the fixes! They are working fine here!