Menu

Compiling FatFS

Help
Ron C
2016-09-13
2016-09-15
  • Ron C

    Ron C - 2016-09-13

    Hi there,

    hope everyone is ok.

    Looking for some help compiling FatFS with SDCC:

    sdcc -v
    SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.5.6 #9584 (Mac OS X i386)

    The ff.c compilation is not going allright, lots of unreachable code.
    Wonder if it is related with the #define's in the code.

    I being working on a project for a long time, to get stuck now by something like this.
    I might try compiling under windows, maybe a have better luck but anyway, my main env is Mac so I would like to understand what is going on.

    I did no changes to ff.c, and here it is how it looks like when compiling:

    sdcc -mz80 -I./include --no-peep -c -o ff.rel testfatfs/ff.c
    testfatfs/ff.c:1890: warning 126: unreachable code
    testfatfs/ff.c:1890: warning 126: unreachable code
    testfatfs/ff.c:1890: warning 126: unreachable code
    testfatfs/ff.c:1890: warning 126: unreachable code
    testfatfs/ff.c:1890: warning 126: unreachable code
    testfatfs/ff.c:1890: warning 126: unreachable code
    testfatfs/ff.c:1890: warning 126: unreachable code
    testfatfs/ff.c:1890: warning 126: unreachable code
    testfatfs/ff.c:1904: warning 126: unreachable code
    testfatfs/ff.c:1904: warning 126: unreachable code
    testfatfs/ff.c:1904: warning 126: unreachable code
    testfatfs/ff.c:1904: warning 126: unreachable code
    testfatfs/ff.c:1904: warning 126: unreachable code
    testfatfs/ff.c:1904: warning 126: unreachable code
    testfatfs/ff.c:1904: warning 126: unreachable code
    testfatfs/ff.c:1904: warning 126: unreachable code
    testfatfs/ff.c:1987: warning 126: unreachable code
    testfatfs/ff.c:1987: warning 126: unreachable code
    testfatfs/ff.c:1988: warning 126: unreachable code
    testfatfs/ff.c:1988: warning 126: unreachable code
    testfatfs/ff.c:1988: warning 126: unreachable code
    testfatfs/ff.c:1988: warning 126: unreachable code
    testfatfs/ff.c:1988: warning 126: unreachable code
    testfatfs/ff.c:1988: warning 126: unreachable code
    testfatfs/ff.c:1988: warning 126: unreachable code
    testfatfs/ff.c:1989: warning 126: unreachable code
    testfatfs/ff.c:1990: warning 126: unreachable code
    testfatfs/ff.c:1990: warning 126: unreachable code
    testfatfs/ff.c:2104: warning 126: unreachable code
    testfatfs/ff.c:2104: warning 126: unreachable code
    testfatfs/ff.c:2108: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG

    Any one would have any suggestion to get over this, workaround, anything ?

    thanks a lot
    Roni

     
  • Philipp Klaus Krause

    These are all just warnings, not erros. They might indeed be related some some configuration #ifdefs, in whic case there would be no problem.

    Philipp

    P.S.: It's been a while since I've compiled FatFS myself, so I'm not familiar with the current version (and probably forgot most of what I knew about the older versions). You might also want to ask in the FatFS forum.

    P.P.S.: Why not use a more current version of SDCC?

     
    • Ron C

      Ron C - 2016-09-15

      Hi Philipp,

      I updated to latest version. I thought I had it, but I was wrong.
      Any way, you are correct, the warnings re related to #ifdefs and also some #defines for constants equals to zero that are used inside "if"'s, that end up being always false.

      Therefore I have cleared all compilation errors, and now assuming these warnings are nor a problem.

       
  • alvin

    alvin - 2016-09-15

    You may also want to check if chars need to be signed. By default they are unsigned and if the program expects signed you will see those types of errors too. Just add "--fsigned-char" to the compile if that's the case.

     

Log in to post a comment.