[MDEV-16892] compiler warnings of gcc 7 in tabjson.ccp Created: 2018-08-03  Updated: 2018-08-09  Resolved: 2018-08-08

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Oleksandr Byelkin Assignee: Olivier Bertrand
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0

|| storage/connect/tabjson.cpp: In function ‘_qryres* JSONColumns(PGLOBAL, PCSZ, PCSZ, PTOS, bool)’:
/home/sanja/maria/git/server/storage/connect/tabjson.cpp|72 col 9| warning: no previous declaration for ‘_qryres* JSONColumns(PGLOBAL, PCSZ, PCSZ, PTOS, bool)’ [-Wmissing-declarations]
||  PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info)
||          ^~~~~~~~~~~



 Comments   
Comment by Olivier Bertrand [ 2018-08-08 ]

Just a warning from a parano compiler.

Comment by Daniel Black [ 2018-08-09 ]

Just an ignored bug from a developer who can't code to the standard of the compiler.

When you start ignoring warnings you get code that works by pure dumb luck. You know the difference between a pointer and value right?
https://github.com/MariaDB/server/pull/808

Or warnings like CONC-329 that actually change the behaviour.

A culture of ignoring warnings or attributing them to parano compliers isn't very reassuring and reflects beyond the connect engine to mariadb overall.

Comment by Olivier Bertrand [ 2018-08-09 ]

Sure enough, but it depends on the warning. I just spent several days fixing MDEV-16672 by removing many warnings some of them showing the possibility of real bugs. Just to say that I have no culture of ignoring warnings.

But this one is the most stupid one I know. It just says that instead of:

PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info)
{
...
}

this compiler requires:

PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info);
 
PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info)
{
...
}

Why not but, in addition, if this is regarded as a bug, it is a gcc compiler bug. Indeed, this declaration does exist in tabjson.h line 19 that is included by tabjson.cpp (unless perhaps you are using an old MariaDB version?)

This is why I reported it as "Not a bug" and not "Won't fix" because it was not ignored but already fixed.

Anyway, thanks for reporting warnings that are not issued by all compilers, but because they are reported as "bugs", they should not be over qualify as "Major" when they are clearly not.

Generated at Thu Feb 08 08:32:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.