Re: [sqlite] configure syntax error on HP

2008-06-23 Thread Dennis Cote
Dan wrote:
> 
> You don't, by chance, know how to get gcc to report variable  
> declarations
> mixed in with code as errors (or warnings) do you?
> 
> i.e. how do I get the following to cause an error?
> 
>void somefunction(){
>  int one;
>  popuateOne();
>  int two;
>}
> 

With gcc you can add the --pedantic option to get more errors and 
warnings. Add -Wall to turn all warnings into errors as well.

$ gcc --ansi --pedantic test.c
test.c: In function `somefunction':
test.c:4: warning: ISO C90 forbids mixed declarations and code
C:/DOCUME~1/DENNIS~1.HAR/LOCALS~1/Temp/ccOS.o:test.c:(.text+0xd): 
undefined reference to `popuateOne'

HTH
Dennis Cote
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-22 Thread Jay A. Kreibich
On Sun, Jun 22, 2008 at 05:36:32PM -0400, Matt Sergeant scratched on the wall:
> On Sat, 21 Jun 2008 11:50:31 +0700, Dan wrote:
> >> On Thu, 19 Jun 2008 12:05:56 -0400, D. Richard Hipp wrote:
> >>> On Jun 19, 2008, at 11:49 AM, Matt Sergeant wrote:
>  
>  Note that there are some C++ style comments crept back into the code

> >> Good. You might want to consider adding a test for this -
> > 
> > How do you test this?
> 
> Effectively a grep for '//' minus those matching http://.


  Or you could just use a C compiler


  If you're using gcc, "-ansi" will turn off all the "bending of the
  rules" the default gcc environment has, including the ability to
  understand C++ style comments.

  For this and other reasons, I would suggest altering the Makefiles
  so that "-ansi" is used any time gcc is being used.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"'People who live in bamboo houses should not throw pandas.' Jesus said that."
   - "The Ninja", www.AskANinja.com, "Special Delivery 10: Pop!Tech 2006"
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-22 Thread Matt Sergeant
On Sat, 21 Jun 2008 11:50:31 +0700, Dan wrote:
> 
>> On Thu, 19 Jun 2008 12:05:56 -0400, D. Richard Hipp wrote:
>>> 
>>> On Jun 19, 2008, at 11:49 AM, Matt Sergeant wrote:
 
 Note that there are some C++ style comments crept back into the code
 (I
 noticed in the amalgamation, so I can't give you a direct pointer to
 them). This causes compile failures on stricter C compilers.
>>> 
>>> 
>>> Already been fixed.  http://www.sqlite.org/cvstrac/chngview?cn=5207
>>> and http://www.sqlite.org/cvstrac/tktview?tn=3172
>> 
>> Good. You might want to consider adding a test for this - my
>> DBD::SQLite does one, but I'd rather you catch things upstream.
> 
> How do you test this?

Effectively a grep for '//' minus those matching http://.

Matt.

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-20 Thread Dan

On Jun 21, 2008, at 1:27 AM, Matt Sergeant wrote:

> On Thu, 19 Jun 2008 12:05:56 -0400, D. Richard Hipp wrote:
>>
>> On Jun 19, 2008, at 11:49 AM, Matt Sergeant wrote:
>>>
>>> Note that there are some C++ style comments crept back into the code
>>> (I
>>> noticed in the amalgamation, so I can't give you a direct pointer to
>>> them). This causes compile failures on stricter C compilers.
>>
>>
>> Already been fixed.  http://www.sqlite.org/cvstrac/chngview?cn=5207
>> and http://www.sqlite.org/cvstrac/tktview?tn=3172
>
> Good. You might want to consider adding a test for this - my
> DBD::SQLite does one, but I'd rather you catch things upstream.

How do you test this?

Dan.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-20 Thread Matt Sergeant
On Thu, 19 Jun 2008 12:05:56 -0400, D. Richard Hipp wrote:
> 
> On Jun 19, 2008, at 11:49 AM, Matt Sergeant wrote:
>> 
>> Note that there are some C++ style comments crept back into the code  
>> (I
>> noticed in the amalgamation, so I can't give you a direct pointer to
>> them). This causes compile failures on stricter C compilers.
> 
> 
> Already been fixed.  http://www.sqlite.org/cvstrac/chngview?cn=5207  
> and http://www.sqlite.org/cvstrac/tktview?tn=3172

Good. You might want to consider adding a test for this - my 
DBD::SQLite does one, but I'd rather you catch things upstream.

Matt.

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-19 Thread D. Richard Hipp

On Jun 19, 2008, at 11:49 AM, Matt Sergeant wrote:
>
> Note that there are some C++ style comments crept back into the code  
> (I
> noticed in the amalgamation, so I can't give you a direct pointer to
> them). This causes compile failures on stricter C compilers.


Already been fixed.  http://www.sqlite.org/cvstrac/chngview?cn=5207  
and http://www.sqlite.org/cvstrac/tktview?tn=3172

D. Richard Hipp
[EMAIL PROTECTED]



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-19 Thread Dan

On Jun 19, 2008, at 10:49 PM, Matt Sergeant wrote:

> On Wed, 18 Jun 2008 19:58:02 -0400, D. Richard Hipp wrote:
>>
>> On Jun 18, 2008, at 7:12 PM, Andrea Connell wrote:
>>
>>> I want to use the C API with a C++ class but when I try compiling...
>>>
>>> $ aCC -AA +W829 main.cpp sqlite3.c
>>> main.cpp:
>>> sqlite3.c:
>>> Error 482: "sqlite3.c", line 532 # Array of unknown size; 'const  
>>> char
>>
>> SQLite is written in C, not C++.  You have to use a C compiler to
>> compile it.  If you compile to object code, you can normally link it
>> against C++ code without difficulty.  But you cannot compile SQLite
>> directly using a C++ compiler.
>
> Note that there are some C++ style comments crept back into the  
> code (I
> noticed in the amalgamation, so I can't give you a direct pointer to
> them). This causes compile failures on stricter C compilers.


I think this problem was fixed by [5207]:

   http://www.sqlite.org/cvstrac/chngview?cn=5207

Please post a bug report or a message here if there are others
that need to be removed.

Dan.




___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-19 Thread Matt Sergeant
On Wed, 18 Jun 2008 19:58:02 -0400, D. Richard Hipp wrote:
> 
> On Jun 18, 2008, at 7:12 PM, Andrea Connell wrote:
> 
>> I want to use the C API with a C++ class but when I try compiling...
>> 
>> $ aCC -AA +W829 main.cpp sqlite3.c
>> main.cpp:
>> sqlite3.c:
>> Error 482: "sqlite3.c", line 532 # Array of unknown size; 'const char
> 
> SQLite is written in C, not C++.  You have to use a C compiler to  
> compile it.  If you compile to object code, you can normally link it  
> against C++ code without difficulty.  But you cannot compile SQLite  
> directly using a C++ compiler.

Note that there are some C++ style comments crept back into the code (I 
noticed in the amalgamation, so I can't give you a direct pointer to 
them). This causes compile failures on stricter C compilers.

Matt.

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-19 Thread Andrea Connell
 
Okay that worked, thanks.

Just curious though... I've compiled C and C++ code together many times.
I've never had a problem before since C is basically a subset of C++.
Why doesn't it work here?


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of D. Richard Hipp
Sent: Wednesday, June 18, 2008 6:58 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] configure syntax error on HP


On Jun 18, 2008, at 7:12 PM, Andrea Connell wrote:

> I want to use the C API with a C++ class but when I try compiling...
>
> $ aCC -AA +W829 main.cpp sqlite3.c
> main.cpp:
> sqlite3.c:
> Error 482: "sqlite3.c", line 532 # Array of unknown size; 'const char

SQLite is written in C, not C++.  You have to use a C compiler to
compile it.  If you compile to object code, you can normally link it
against C++ code without difficulty.  But you cannot compile SQLite
directly using a C++ compiler.

D. Richard Hipp
[EMAIL PROTECTED]



___
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


Re: [sqlite] configure syntax error on HP

2008-06-18 Thread D. Richard Hipp

On Jun 18, 2008, at 7:12 PM, Andrea Connell wrote:

> I want to use the C API with a C++ class but when I try compiling...
>
> $ aCC -AA +W829 main.cpp sqlite3.c
> main.cpp:
> sqlite3.c:
> Error 482: "sqlite3.c", line 532 # Array of unknown size; 'const char

SQLite is written in C, not C++.  You have to use a C compiler to  
compile it.  If you compile to object code, you can normally link it  
against C++ code without difficulty.  But you cannot compile SQLite  
directly using a C++ compiler.

D. Richard Hipp
[EMAIL PROTECTED]



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-18 Thread Andrea Connell
>On Jun 18, 2008, at 5:38 PM, Andrea Connell wrote:
>
>> I'm trying to compile 3.5.9 on an HP-UX 11i v1 machine but I can't
get
>> past step one...
>>
>> I unpacked the amalgamation, cd'd to the directory, and ran
>> './configure' - that didn't work so I tried 'sh ./configure' like the
>> install instructions suggest. I got a syntax error right away.
>>
>> ~/sqlite/sqlite-amalgamation-3.5.9.tar/sqlite-amalgamation-3.5.9
>> lacpghp1> ./configure
>> interpreter "/bin/sh" not found
>
>A system without /bin/sh hardly qualifies as Unix, does it?
>
>Looks like you are going to need to compile it yourself.  Ignore the  
>configure script.  Just type something like this:
>
>  cc -o sqlite3 -DSQLITE_THREADSAFE=0 - 
>DSQLITE_OMIT_LOAD_EXTENSION=1 sqlite3.c shell.c
>
>You might need to add some "-l..." arguments on the end to specify  
>libraries, but perhaps not.  The -DSQLITE_THREADSAFE=0 eliminates the  
>needs for pthreads and -DSQLITE_OMIT_LOAD_EXTENSION=1 removes the  
>requirement for dlopen, and on most systems those are the only two  
>libraries required.  But if your system doesn't have a Bourne shell,  
>who knows what other peccadillos lurk around the next corner...
>
>D. Richard Hipp
>drh at hwaci.com
 
 
Yea it's pretty scary. I'm not sure if something is screwy on the box
itself or if it's just my account. Either way I'm hoping I can work
around it without too much pain and suffering. 
 
I tried your suggestion and it didn't give any errors
$ cc -o sqlite3 -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION=1
sqlite3.c shell.c
sqlite3.c:
shell.c:
$
 
I can run the CLI now, but there must be more to do. Ultimately I want
to use the C API with a C++ class but when I try compiling...
 
$ aCC -AA +W829 main.cpp sqlite3.c
main.cpp:
sqlite3.c:
Error 482: "sqlite3.c", line 532 # Array of unknown size; 'const char
[]' is
incomplete.
SQLITE_API const char sqlite3_version[];
  ^^^
Error 204: "sqlite3.c", line 6464 # Uninitialized const variable "const
int
sqlite3one".
SQLITE_PRIVATE const int sqlite3one;
 ^^
Error 203: "sqlite3.c", line 10309 # Cannot assign 'char *' with 'void
*'.
z = sqlite3_malloc( n );
^^^
Error 203: "sqlite3.c", line 11101 # Cannot assign 'long long *' with
'void
*'.
  p = malloc(nBytes+8);
  
Error 203: "sqlite3.c", line 11104 # Cannot assign 'long long *' with
'void
*'.
p = malloc(nBytes+8);

Error 203: "sqlite3.c", line 11130 # Cannot assign 'long long *' with
'void
*'.
  p = pPrior;
  ^^
Error 203: "sqlite3.c", line 11145 # Cannot assign 'long long *' with
'void
*'.
  pInt = p;
 ^
Error 203: "sqlite3.c", line 11162 # Cannot assign 'long long *' with
'void
*'.
  p = pPrior;
  ^^
Error 203: "sqlite3.c", line 11173 # Cannot assign 'long long *' with
'void
*'.
p = realloc(p, nBytes+8);

Error 203: "sqlite3.c", line 11176 # Cannot assign 'long long *' with
'void
*'.
  p = pPrior;
  ^^
Error 203: "sqlite3.c", line 11178 # Cannot assign 'long long *' with
'void
*'.
  p = realloc(p, nBytes+8);
  
Error 419: "/usr/include/sys/pset.h", line 186 # 'spu_t' is used as a
type,
but has not been defined as a type.
extern int pset_assign ( psetid_t pset, spu_t spu, psetid_t*
opset)
^
Error 699: "/usr/include/sys/pset.h", line 186 # Error limit reached;
halting
compilation.
extern int pset_assign ( psetid_t pset, spu_t spu, psetid_t*
opset)
^
$
 
Blech. Can I have a clue to my next step?
 
Thanks,
Andrea
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] configure syntax error on HP

2008-06-18 Thread D. Richard Hipp

On Jun 18, 2008, at 5:38 PM, Andrea Connell wrote:

> I'm trying to compile 3.5.9 on an HP-UX 11i v1 machine but I can't get
> past step one...
>
> I unpacked the amalgamation, cd'd to the directory, and ran
> './configure' - that didn't work so I tried 'sh ./configure' like the
> install instructions suggest. I got a syntax error right away.
>
> ~/sqlite/sqlite-amalgamation-3.5.9.tar/sqlite-amalgamation-3.5.9
> lacpghp1> ./configure
> interpreter "/bin/sh" not found

A system without /bin/sh hardly qualifies as Unix, does it?

Looks like you are going to need to compile it yourself.  Ignore the  
configure script.  Just type something like this:

  cc -o sqlite3 -DSQLITE_THREADSAFE=0 - 
DSQLITE_OMIT_LOAD_EXTENSION=1 sqlite3.c shell.c

You might need to add some "-l..." arguments on the end to specify  
libraries, but perhaps not.  The -DSQLITE_THREADSAFE=0 eliminates the  
needs for pthreads and -DSQLITE_OMIT_LOAD_EXTENSION=1 removes the  
requirement for dlopen, and on most systems those are the only two  
libraries required.  But if your system doesn't have a Bourne shell,  
who knows what other peccadillos lurk around the next corner...

D. Richard Hipp
[EMAIL PROTECTED]



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users