pankajk / blockchain

Automatically exported from code.google.com/p/blockchain
0 stars 0 forks source link

sprintf_s on linux #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. make on linux
2.
3.

What is the expected output? What do you see instead?
>>make
g++ *.cpp -o blockchain.out
BlockChain.cpp: In function ‘const char* getDateString(time_t)’:
BlockChain.cpp:81:84: error: ‘sprintf_s’ was not declared in this scope
  sprintf_s(scratch,"%4d-%02d-%02d", gtm->tm_year+1900, gtm->tm_mon+1, gtm->tm_mday );
                                                                                    ^
BlockChain.cpp: In constructor ‘ZombieFinder::ZombieFinder()’:
BlockChain.cpp:3057:16: warning: converting to non-pointer type ‘uint64_t 
{aka long unsigned int}’ from NULL [-Wconversion-null]
   mLastBalance = NULL;
                ^
BlockChain.cpp: In member function ‘virtual void 
BlockChainImpl::reportTransactionValues(uint32_t)’:
BlockChain.cpp:6581:73: error: ‘sprintf_s’ was not declared in this scope
    sprintf_s(scratch,512,"TransactionValues-%s.csv", getDateString(date));
                                                                         ^
main.cpp: In function ‘const char* getDateString(time_t)’:
main.cpp:24:84: error: ‘sprintf_s’ was not declared in this scope
  sprintf_s(scratch,"%4d-%02d-%02d", gtm->tm_year+1900, gtm->tm_mon+1, gtm->tm_mday );
                                                                                    ^
make: *** [blockchain.out] Error 1

What version of the product are you using? On what operating system?
Version: checked out today (Oct-08-2014)
0S:
>>uname -a
Linux APU 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 
x86_64 x86_64 GNU/Linux

Please provide any additional information below.
>>grep sprintf_s *.*
BlockChain.cpp: sprintf_s(scratch,"%4d-%02d-%02d", gtm->tm_year+1900, 
gtm->tm_mon+1, gtm->tm_mday );
BlockChain.cpp:         sprintf_s(scratch,512,"EXPORT_%04d_%02d_%02d.csv", 
1900+gtm->tm_year, gtm->tm_mon+1, gtm->tm_mday );
BlockChain.cpp:         sprintf_s(scratch,512,"TransactionValues-%s.csv", 
getDateString(date));
main.cpp:   sprintf_s(scratch,"%4d-%02d-%02d", gtm->tm_year+1900, gtm->tm_mon+1, 
gtm->tm_mday );

Original issue reported on code.google.com by aws....@gmail.com on 8 Oct 2014 at 9:26

GoogleCodeExporter commented 8 years ago
Assuming Windows target? Come on. I really want to use this library but will 
have to search for an alternative until you support Linux again.

Original comment by gustafso...@gmail.com on 3 Nov 2014 at 10:59