Re: [sqlite] Porting SQLite to Nurit OS ver

2014-07-02 Thread Stephan Beal
On Wed, Jul 2, 2014 at 2:41 PM, Clemens Ladisch  wrote:

> > |Prototype causes non-standard conversion from `int' to
> `sqlite3_int64'
>
> This is just an overzealous and absurdly useless warning.
> Try to reduce the warning level.
>

AFAIK, any conversion from a less precise type to a more precise type is
does not constitute a warning. Only when precision "could" be lost
(int64==>int, or signedness differences) is a warning in order. Maybe
sqlite3_int64 on that platform is of a type smaller than int, or is
unsigned? That'd be weird, but i've seen weirder (8-byte booleans!).

> warning 572: Potentially dangerous pointer cast:
> > |sizeof `struct FuncDef' ("../sqlite/sqlite3.c",L8668/C24) differs
> from
> > |sizeof `struct FuncDef[8]' and
> > |accessing an lvalue through this pointer alias may violate
> assumptions
> > |in the ANSI C Language Reference used by the optimizer.
> > |(See (X3.159-1989 p.39,L18) on object access for more details.)
>
> I'm quite sure that this interpretation of the standard is plain wrong,
>

+1, and unless i'm misunderstanding the problem (haven't got the code on
this machine and am too lazy to google it up), it's simple to deduce that
this is a compiler bug: in C, for any array of type X, any element of that
array is guaranteed to be exactly sizeof(X). C guarantees this, or
conventional array traversal (via ptr++ resp. ++ptr) could not work.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Porting SQLite to Nurit OS ver

2014-07-02 Thread Clemens Ladisch
Paulo Roberto wrote:
> I'm trying to port SQLite (3.08.04.03) to the Nurit 8400 POS device that
> has an ARM 7 processor and is running Nurit OS 7.50.13a
>
> The error appears when the compiler is building the sqlite.c file (the same
> flags are used).

> |Prototype causes non-standard conversion from `int' to `sqlite3_int64'

This is just an overzealous and absurdly useless warning.
Try to reduce the warning level.

> warning 572: Potentially dangerous pointer cast:
> |sizeof `struct FuncDef' ("../sqlite/sqlite3.c",L8668/C24) differs from
> |sizeof `struct FuncDef[8]' and
> |accessing an lvalue through this pointer alias may violate assumptions
> |in the ANSI C Language Reference used by the optimizer.
> |(See (X3.159-1989 p.39,L18) on object access for more details.)

I'm quite sure that this interpretation of the standard is plain wrong,
but I don't have that particular edition.  (If I were suspicious, I'd
assume that this is why they specified the page number instead of the
section.)

> [color] Max attempts exhausted at 2 with 12 regs in contention. All registers 
> spilled!!
> ...

Anyway, that compiler is just buggy.  You could try to reduce or disable
optimizations, but I wouldn't trust the compiler output anyway.

If possible, use gcc.


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


Re: [sqlite] Porting SQLite to Nurit OS ver

2014-07-02 Thread Kees Nuyt
On Wed, 2 Jul 2014 12:02:01 +0100, Simon Slavin 
wrote:

>
> Thank you for your precise and useful description of what is happening.
>
> Unfortunately this list does not allow attachments, but can you paste
> a copy of the final error, the one about the register map,
> to one of your posts ?  Make sure we can see both the full
> error text and which line of code it's complaining about.

The error report was included, you just have to scroll down a bit more.

-- 
Groet, Cordialement, Pozdrawiam, Regards,

Kees Nuyt

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


Re: [sqlite] Porting SQLite to Nurit OS ver

2014-07-02 Thread Simon Slavin

On 1 Jul 2014, at 10:32pm, Paulo Roberto  wrote:

> There are a lot of warnings due to data type conversion and in the end an
> error relative to register map that I didn't understand.
> 
> I would appreciate any help to solve this issue and build it correctly.
> 
> The compiler used is an hcarm 4.5a.
> The building process output is below in italic and the error output in bold.

Thank you for your precise and useful description of what is happening.

Unfortunately this list does not allow attachments, but can you paste a copy of 
the final error, the one about the register map, to one of your posts ?  Make 
sure we can see both the full error text and which line of code it's 
complaining about.

The warnings about type conversion you can ignore.  Because SQLite's source 
code has to be suitable for many different compilers, it's possible to get rid 
of warnings from every compiler that may be used and they each enforce type 
conversion differently.  But we treat errors as more serious than warnings and 
may be able to figure out what's causing your register map error.

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