The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Compiling WP-34S
11-24-2019, 09:30 AM
Post: #1
Compiling WP-34S
I'm attempting to compile WP34S from sources.
I've checked source out using svn. Current revision is 3912.
I haven't modified the code.
I'm getting an error from keys.c about a misleading indent (line 2057)

I can see what it means about the misleading indent, but "fixing" that, either by unindenting line 2057 or bracketing 2056-67, of course does not resolve the fact that it is trying to return a value to main() - it only gets rid of the misleading indent warning.
I'm trying to find an unmatched brace or something to account for it, but I'm not familiar with this code, and I'm struggling. I'm hoping one of the devs might be willing to have a look and confirm the intention on line 2056-57 and help me find where this is going wrong?
Please?
I'm trying to get to the point that I can compile it all, including the QT gui for linux.

Code:

arm-none-eabi-gcc -mthumb -mcpu=arm7tdmi -Os -fira-region=one -Wall -Werror -g -fno-common -fno-exceptions  -DREALBUILD=1 -Dat91sam7l128=1 -Iatmel -DNO_BACKUP_INIT=1 -DNO_RAM_COPY=1 -IdecNumber -o realbuild/calc -nostartfiles  -T wp34s.lds -Wl,--gc-sections,-Map=realbuild/mapfile.txt \
    atmel/board_cstartup.S asone.c -nostdlib -lgcc -LLinux64_realbuild/obj -lconsts -fwhole-program -ldecNum34s # -save-temps
main.c: In function 'main':
<built-in>: error: function declared 'noreturn' has a 'return' statement [-Werror]
In file included from asone.c:49:0:
keys.c: In function 'process_multi':
keys.c:2055:3: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
   else
   ^~~~
keys.c:2057:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
    return STATE_UNFINISHED;
    ^~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:348: realbuild/calc.bin] Error 1
jpcuzzourt@mx:~/wp34s/wp34s-code
$

Here is the code snippet:
Code:

$ cat -n keys.c|sed -n '2031,2063p'
  2031        switch (c) {
  2032        case K20:    // Enter - exit multi mode, maybe return a result
  2033            if (shift != SHIFT_N)
  2034                    break;
  2035            reset_multi();
  2036            if (State2.numdigit == 0)
  2037                return STATE_UNFINISHED;
  2038            else if (State2.numdigit == 1)
  2039                State2.digval2 = 0;
  2040            goto fin;
  2041    
  2042        case K24:    // Clx - backspace, clear alpha
  2043            if (shift != SHIFT_H) {
  2044                if (State2.numdigit == 0)
  2045                    reset_multi();
  2046                else
  2047                    State2.numdigit--;
  2048                return STATE_UNFINISHED;
  2049            }
  2050            break;
  2051    
  2052        case K60:    // EXIT/ON maybe case switch, otherwise exit alpha
  2053            if (shift == SHIFT_F)
  2054                State2.alphashift = 1 - State2.alphashift;
  2055            else
  2056                reset_multi();
  2057                return STATE_UNFINISHED;
  2058            
  2059    
  2060        default:
  2061            break;
  2062            }
  2063

Georgia, USA
10BII+, 12C, 14B (AE), 17B, 17BII, 20B, WP-34S, 28S, 35S, 39GS, 48G, 82240A,B
+ sliderules galore, mostly Hemmi/Post & Dietzgen
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Compiling WP-34S - jpcuzzourt - 11-24-2019 09:30 AM
RE: Compiling WP-34S - Paul Dale - 11-24-2019, 09:52 AM
RE: Compiling WP-34S - jpcuzzourt - 11-24-2019, 10:31 AM
RE: Compiling WP-34S - Paul Dale - 11-24-2019, 11:46 AM
RE: Compiling WP-34S - Paul Dale - 11-24-2019, 11:52 AM
RE: Compiling WP-34S - jpcuzzourt - 11-24-2019, 03:14 PM
RE: Compiling WP-34S - Paul Dale - 11-24-2019, 08:51 PM



User(s) browsing this thread: 3 Guest(s)