SWI-Prolog / packages-semweb

The SWI-Prolog RDF store
28 stars 14 forks source link

Unable to compile using a C11 compiler #112

Closed sei-mwd closed 5 months ago

sei-mwd commented 5 months ago

Due to an obscurity in the C11 standard, rdf_db.c causes a compilation error on line 6090. This is because there is a declaration following a label, which is not legal until C23. A simple fix would be to put braces around everything after the error: label.

13:54:38 /srv/jenkins/workspace/pharos-rose/swipl/packages/semweb/rdf_db.c: In function ‘rdf_load_db’:
13:54:38 /srv/jenkins/workspace/pharos-rose/swipl/packages/semweb/rdf_db.c:6090:3: error: a label can only be part of a statement and a declaration is not a statement
13:54:38  6090 |   term_t err = PL_new_term_ref();
13:54:38       |   ^~~~~~
JanWielemaker commented 5 months ago

Thanks. I keep missing this and it doesn't show up in gcc -Wall ...

sei-mwd commented 5 months ago

Thanks! I can confirm that this solves my problem.