Dominique, what I said was that it is undefined behaviour in C++ to return
a *value* in a void function. That is still true.
On Mon, Feb 11, 2019 at 2:49 PM Dominique Devienne
wrote:
> On Mon, Feb 11, 2019 at 1:11 PM Clemens Ladisch
> wrote:
>
> > Peter da Silva wrote:
> > > I am pretty sure
On Mon, Feb 11, 2019 at 1:11 PM Clemens Ladisch wrote:
> Peter da Silva wrote:
> > I am pretty sure that the code is not legal C
>
> Indeed; C99 and C11 say in 6.3.2.2:
> | The (nonexistent) value of a void expression (an expression that has
> | type void) shall not be used in any way [...]
>
Peter da Silva wrote:
> I am pretty sure that the code is not legal C
Indeed; C99 and C11 say in 6.3.2.2:
| The (nonexistent) value of a void expression (an expression that has
| type void) shall not be used in any way [...]
and in 6.8.6.4:
| A return statement with an expression shall not appear
> On Feb 11, 2019, at 6:33 AM, Peter da Silva wrote:
>
> I am pretty sure that the code is not legal C because it's using the return
> value of a void function, as well as returning a value from a void
> function. Compilers that "do what I mean" and accept it are in error. It's
> certainly
I am pretty sure that the code is not legal C because it's using the return
value of a void function, as well as returning a value from a void
function. Compilers that "do what I mean" and accept it are in error. It's
certainly possible that some obscure clause in some C standard blesses it
but I
I'm using cl.exe v19.12.
To summarize:
SQLite 3.24 compiles fine with warning as error enabled with cl.exe v19.12
SQLite 3.27.1 does not compile with warning as error enabled with cl.exe
v19.12.
To me, it looks like a simple fix to avoid writing "return " in void
functions even if is a void
On Mon, Feb 11, 2019 at 11:31 AM Jonas Bülow wrote:
> Sorry, I missed some information. It is the MSVC v15.5 compiler that
> complains:
>
> sqlite3.c(58167): error C2220: warning treated as error - no 'object' file
> generated [c:\work\sqlite-amalgamation-3270100\sqlite3.vcxproj]
>
Sorry, I missed some information. It is the MSVC v15.5 compiler that
complains:
sqlite3.c(58167): error C2220: warning treated as error - no 'object' file
generated [c:\work\sqlite-amalgamation-3270100\sqlite3.vcxproj]
sqlite3.c(58167): warning C4098: 'sqlite3PagerSnapshotUnlock': 'void'
function
On Mon, Feb 11, 2019 at 11:16 AM Jonas Bülow wrote:
> > Just tried to update my sqlite version from 3.24 to 3.27.1 and the
> > compiler complained about a void function returning a value. I don't know
> > about C, but in C++ this is undefined behaviour and the clang compiler
> > sometimes
The subject should say "3.27.1". Sorry!
On Mon, Feb 11, 2019 at 11:14 AM Jonas Bülow wrote:
> Just tried to update my sqlite version from 3.24 to 3.27.1 and the
> compiler complained about a void function returning a value. I don't know
> about C, but in C++ this is undefined behaviour and the
Just tried to update my sqlite version from 3.24 to 3.27.1 and the compiler
complained about a void function returning a value. I don't know about C,
but in C++ this is undefined behaviour and the clang compiler sometimes
generate an ud2 instruction for such code.
It's on line 58165 in
11 matches
Mail list logo