Re: [sqlite] Correction needed in shell.c of 3071300
On Thu, Jul 12, 2012 at 10:25 AM, Roy Soltoff wrote: > Folks, in the latest linux amalgamation download, I needed to add braces > surrounding some of the code in the find_home_dir function to be able to > ccompile without an error. The added braces are identified by the arrows. > The struct declaration cannot occur after a statement; thus the need for > the > braces. > > Joe has already fixed this here: http://www.sqlite.org/src/info/d3d491a546 > > > static char *find_home_dir(void){ > > static char *home_dir = NULL; > > if( home_dir ) return home_dir; > > > > #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && > !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL) > > {ç > > struct passwd *pwent; > > uid_t uid = getuid(); > > if( (pwent=getpwuid(uid)) != NULL) { > > home_dir = pwent->pw_dir; > > } > > }ç > > #endif > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Correction needed in shell.c of 3071300
This depends on that you during compilation force following strict C. I don't use this option on Linux and thus works very well. On 07/12/2012 07:25 PM, Roy Soltoff wrote: > Folks, in the latest linux amalgamation download, I needed to add braces > surrounding some of the code in the find_home_dir function to be able to > ccompile without an error. The added braces are identified by the arrows. > The struct declaration cannot occur after a statement; thus the need for the > braces. > > > > static char *find_home_dir(void){ > > static char *home_dir = NULL; > > if( home_dir ) return home_dir; > > > > #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && > !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL) > > {ç > > struct passwd *pwent; > > uid_t uid = getuid(); > > if( (pwent=getpwuid(uid)) != NULL) { > > home_dir = pwent->pw_dir; > > } > > }ç > > #endif > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Correction needed in shell.c of 3071300
Folks, in the latest linux amalgamation download, I needed to add braces surrounding some of the code in the find_home_dir function to be able to ccompile without an error. The added braces are identified by the arrows. The struct declaration cannot occur after a statement; thus the need for the braces. static char *find_home_dir(void){ static char *home_dir = NULL; if( home_dir ) return home_dir; #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL) {ç struct passwd *pwent; uid_t uid = getuid(); if( (pwent=getpwuid(uid)) != NULL) { home_dir = pwent->pw_dir; } }ç #endif ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users