(11-24-2019 09:52 AM)Paul Dale Wrote: Unindent the return statement to match the indentation of the preceding if and else.
The other error will be more difficult, the main() function does not return for native builds.
It looks like you are trying to build calculator firmware. We had all sorts of problems with arm tool chains introducing bugs. In the end we had to go with a specific version which is now very old. It wasn't advanced enough to produce the diagnostic messages you are seeing.
As for a Qt Linux version, I've never built such. I still use the text console mode when a bug comes up, you really don't want to go there -- I suspect I'm the only person who has ever used it
Pauli
Thanks for the response. Yes, without having found any build instructions, I just jumped in to see what I could manage and learn. I started with the linux-build-arm script and figured once I got all the necessary build chain established for that, I could try looking at the QT stuff. And yes, I'm using all the current Debian stable build tools. (gcc version 8.3 and arm-none-eabi-gcc version 7.3.1)
I had managed building the QT linux version of newRPL, and so I have a lot of that build environment set up and working.
Again, thanks for letting me know the intention of the else clause. Maybe I'll be able to sort out where it's getting mixed up!
(EDIT: turning off -Werror patches this issue - the compiler can't prove whether the return() is going to execute or not, and so it flags the warning. -Werror treats the warning as an error. There are smarter ways to do this, but not for me, not right now.)
-JP
EDIT: Oh, one more thing - you may or may not be interested in the warnings that my tools are generating for pretty.c in compile_cats.c. I haven't looked into these at all yet, but they seem to be indicating some potential buffer overruns.
Code:
In file included from compile_cats.c:1287:
pretty.c: In function ‘dump_opcodes’:
pretty.c:608:28: warning: ‘%s’ directive writing up to 499 bytes into a region of size 493 [-Wformat-overflow=]
sprintf(temp, "[cmplx]%s", cmdpretty);
^~ ~~~~~~~~~
pretty.c:608:6: note: ‘sprintf’ output between 8 and 507 bytes into a destination of size 500
sprintf(temp, "[cmplx]%s", cmdpretty);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:596:28: warning: ‘%s’ directive writing up to 499 bytes into a region of size 493 [-Wformat-overflow=]
sprintf(temp, "[cmplx]%s", cmdpretty);
^~ ~~~~~~~~~
pretty.c:596:6: note: ‘sprintf’ output between 8 and 507 bytes into a destination of size 500
sprintf(temp, "[cmplx]%s", cmdpretty);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:422:20: warning: ‘%s’ directive writing up to 499 bytes into a region of size 49 [-Wformat-overflow=]
sprintf(buf, "'%s'", strlen(cmdpretty) == 3 ? cmdpretty : cmdalias);
^~
pretty.c:422:5: note: ‘sprintf’ output between 3 and 502 bytes into a destination of size 50
sprintf(buf, "'%s'", strlen(cmdpretty) == 3 ? cmdpretty : cmdalias);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:424:28: warning: ‘%s’ directive writing up to 499 bytes into a region of size 492 [-Wformat-overflow=]
sprintf(temp, "[alpha] %s", cmdpretty);
^~ ~~~~~~~~~
pretty.c:424:5: note: ‘sprintf’ output between 9 and 508 bytes into a destination of size 500
sprintf(temp, "[alpha] %s", cmdpretty);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:507:19: warning: ‘%s’ directive writing up to 499 bytes into a region of size 50 [-Wformat-overflow=]
sprintf(buf, "%s Z", cmdpretty);
^~ ~~~~~~~~~
pretty.c:507:5: note: ‘sprintf’ output between 3 and 502 bytes into a destination of size 50
sprintf(buf, "%s Z", cmdpretty);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:501:19: warning: ‘%s’ directive writing up to 499 bytes into a region of size 50 [-Wformat-overflow=]
sprintf(buf, "%s Y", cmdpretty);
^~ ~~~~~~~~~
pretty.c:501:5: note: ‘sprintf’ output between 3 and 502 bytes into a destination of size 50
sprintf(buf, "%s Y", cmdpretty);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:490:23: warning: ‘%c’ directive writing 1 byte into a region of size between 0 and 499 [-Wformat-overflow=]
sprintf(temp, "%s %c%c%c%c", cmdpretty,
^~
pretty.c:490:5: note: ‘sprintf’ output between 6 and 505 bytes into a destination of size 500
sprintf(temp, "%s %c%c%c%c", cmdpretty,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
REGNAMES[c & 3], REGNAMES[(c >> 2) & 3],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
REGNAMES[(c >> 4) & 3], REGNAMES[(c >> 6) & 3]);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:455:30: warning: ‘%s’ directive writing up to 499 bytes into a region of size 491 [-Wformat-overflow=]
sprintf(temp, "[cmplx]# %s", cmdpretty);
^~ ~~~~~~~~~
pretty.c:455:6: note: ‘sprintf’ output between 10 and 509 bytes into a destination of size 500
sprintf(temp, "[cmplx]# %s", cmdpretty);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:455:30: warning: ‘%s’ directive writing up to 499 bytes into a region of size 491 [-Wformat-overflow=]
sprintf(temp, "[cmplx]# %s", cmdpretty);
^~ ~~~~~~~~~
pretty.c:455:6: note: ‘sprintf’ output between 10 and 509 bytes into a destination of size 500
sprintf(temp, "[cmplx]# %s", cmdpretty);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pretty.c:461:23: warning: ‘%s’ directive writing up to 499 bytes into a region of size 498 [-Wformat-overflow=]
sprintf(temp, "# %s", cmdpretty);
^~ ~~~~~~~~~
pretty.c:461:6: note: ‘sprintf’ output between 3 and 502 bytes into a destination of size 500
sprintf(temp, "# %s", cmdpretty);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~