Shop OBEX P1 Docs P2 Docs Learn Events
FlexProp: a complete programming system for P2 (and P1) - Page 40 — Parallax Forums

FlexProp: a complete programming system for P2 (and P1)

1373840424355

Comments

  • I've updated the compiler so that in C that warning will only happen if -Wall is given.

  • Should probably break out the individual warn flags then (can probably recycle -O parsing code)

  • pik33pik33 Posts: 2,366

    A manual (Basic) remark:

    Hexadecimal (base 16) integers start with the sequence "&h", "0h", or "0x" followed by digits and/or the letters A-F or a-f.
    

    FlexBasic also accepts $ for hexadecimal (and I don't use anything else for it in my programs)

  • Eric,
    I did as you suggested and went to Help and about. The version number doesn't seem to be correct. 5.9.10 in what is supposed to be 5,9,21
    Jim

  • @RS_Jim said:
    Eric,
    I did as you suggested and went to Help and about. The version number doesn't seem to be correct. 5.9.10 in what is supposed to be 5,9,21
    Jim

    Then something is very wrong with your installation. I suggest you re-install. The newest version is 5.9.23.

  • Ok Eric,
    I will upgrade to ver 5.9.23 as soon as I can see it on github
    Jim

  • @RS_Jim said:
    Ok Eric,
    I will upgrade to ver 5.9.23 as soon as I can see it on github
    Jim

    Jim, I thought you were on Linux? If so, just follow the instructions in the README.md on github to build from source. Do a fresh installation (rename any existing flexprop directory you have so it won't interfere, and check out the github repo into a new directory).

  • There is a new binary release of FlexProp available on Patreon and on github. By happy coincidence the version number is 5.9.23, just as 2023 is about to start :).

    The GUI has some improvements to the built in ANSI terminal. Changes to the compiler include:

    Version 5.9.23
    - Enable DEBUG in inline assembly if -gbrk is active
    - Fixed .lbl+n expressions in inline assembly
    - Fixed Spin2 loops so that the correct value is in the variable if the loop is quit
    - Fixed Nucode evaluation of some bit operations
    - Fixed a crash when duplicate names declared in anonymous structs
    - Made sure all registers involved in a large data structure are allocated if any of them are used
    
    Version 5.9.22
    - Added control over individual warnings
    - Define a symbol __DEBUG__ when -g or -gbrk is given
    - Fixed indirect method pointer calls in Spin2 (like LONG[x](foo))
    - Fixed compiling some boolean expressions involving 64 bit integers
    - Fixed QCOS and QSIN when used with angles larger than twopi
    - Fixed some signed/unsigned conflicts in Spin constant evaluation
    - Made foo.[n] produce the same results on P2 as the usual Spin2 compiler, by having it extract the upper bits to find the range of bits affected
    - New optimization to use SUMxx instructions if possible (thanks Ada!)
    - New optimizations for memcpy/memmove (again, thanks to Ada)
    - Removed <- and -> operators from Spin2 (use ROL and ROR instead)
    - Revised P2 frequency calculations to match Chip's latest version
    - Some floating point optimizations from Ada
    - Several other miscellaneous optimizations from Ada
    - Spin2cpp now respects '!cse' optimization flag.
    - Warnings about C strings being passed to non-const pointers now only happen with -Wall
    
  • Eric,
    Here is a screenshot of my screen when I an running what is supposed to be flexprop 5.9.23.
    Jim

  • JonnyMacJonnyMac Posts: 9,082
    edited 2022-12-30 21:59

    I don't use FlexProp but do keep updated, and mine shows the correct version (I'm using Windows, and "upgrading" is as simple as deleting the old folder and replacing it with the new one).

  • Eric,
    Here is what I paste into my terminal to get the new install:
    cd $HOME
    mkdir -p src
    cd src
    sudo apt-get update
    sudo apt-get install build-essential
    sudo apt-get install bison git tk8.6-dev
    sudo apt-get install texlive-latex-recommended pandoc
    git clone --recursive https://github.com/totalspectrum/flexprop
    cd flexprop
    make install INSTALL=~/flexprop
    cd ~/flexprop
    ./flexprop

    When I go to help about I get the screen that I posted in the screen shot attached to my previous post.

    Jim

  • @RS_Jim: before doing all of those commands do:

    rm -rf ~/flexprop
    rm -rf ~/src/flexprop
    

    to remove the old flexprop installation, and then do the steps above. Obviously for some reason the old installation is still around, but I don't know what could be causing it on your system -- nobody else seems to have that issue, and when I do a fresh install I always get the correct version.

  • Thanks Jon,
    Before I install a new version I rename the folder to oldflexprop(#) so that I still have everything I have worked on previously. I don't know why I keep getting the old version numbers in what are supposed to be new versions of flexprop.
    Jim

  • Eric,
    rm -rf ~/flexprop
    rm -rf ~/src/flexprop
    was the magic sauce! I now have 5.9.23!
    Now back to trouble shooting my problem!
    Jim

  • pik33pik33 Posts: 2,366

    sudo apt-get install texlive-latex-recommended pandoc

    I don't know why, but I had a problem with dependencies until I added texlive-latex-extra to the install list on a RPi

  • @ersmith said:
    @Ariba @whicker this is a case where FlexC is following the spirit of the C standard rather than the letter; strictly speaking a string literal should have type "char []" rather than type "const char[]", even though they are not supposed to be writable. I'll add some way to disable that particular warning.

    Erik, perhaps you can prepone or postpone an ID to each message like [ID123:020] ie [IDmsg:line] ie message class/id and line number

    The user can then make a file with the same name and eg .moff (message shutdown) extension. ie:

    • source1.spin and source1.moff
    • source2.bas and source2.moff
    • source3.c and source3.moff

    in the same folder of course.
    An example for a possible .moff file:

    //disable message id 010 for whole source file
    010:
    //disable message id 019 for line number 15, 80 and 50 of the source file
    019:15,80,50,
    //disable message id 125 for whole source file
    125:
    //disable message id 201 for line number 15, 501, 554 and 557 of the source file
    201:15,501,554,557
    //disable all messages for line number 10, 20 and 30 of the source file
    ALL:10,20,30
    //disable all message in the whole file
    ALL:ALL

    Thus this is then customizable for the single source file upon user's needs

    Most probably the user will use only message id without line numbers during development because the line numbers will change frequently.
    But when a suorce file is "closed/finished" perhaps it will still show warnings that we want to remove for the current project (in case this is a driver for example). Here the line numbers can fine tune the "disable tool" deciding what messages to show/hide and where.

    Regards
    Dario

  • @dMajo : In FlexProp 5.9.23 it's already possible to enable/disable individual warnings, on a per-function or global basis. This is described in the general compiler document (general.html or general.pdf) and is very similar to how optimizations can be enabled and disabled.

  • @JonnyMac said:
    I don't use FlexProp but do keep updated, and mine shows the correct version (I'm using Windows, and "upgrading" is as simple as deleting the old folder and replacing it with the new one).

    Yeah, "deleting" is what it seems to take. I renamed and had many WTF moments :lol:

    Craig

  • Eric,
    This evening, I was trying to copy some boiler plate from an existing document to a new one and it failed. I highlighted the text I wanted in the old doc used edit copy switched to the new doc and selected edit paste and...nothing. Did I do something wrong, or is the system not capable of copy between two open files on the screen? Using flexprop 5.9.23.
    Jim

  • @RS_Jim said:
    Eric,
    This evening, I was trying to copy some boiler plate from an existing document to a new one and it failed. I highlighted the text I wanted in the old doc used edit copy switched to the new doc and selected edit paste and...nothing. Did I do something wrong, or is the system not capable of copy between two open files on the screen? Using flexprop 5.9.23.
    Jim

    Copy and paste, and cut and paste, work for me (and for plenty of other people).

  • Eric,
    Having an issue that seems like a bug. in flexprop 5.9.23 I open a file, compile it and run it on P2_Kiss board.
    runs find with all expected results. Using the copy function of the file manager in Linux Mint Cinnamon copy and paste to another directory and I get the error shown in the scree shot attachment. Is this a problen with flexprop or with Linux Mint. Although I don't remember this being a problem with earlier versions of flexprop. It doesn't matter if I edit the program or just copy it to a new directory, the same compiler failure occurs.
    Jim

  • @RS_Jim said:
    Eric,
    Having an issue that seems like a bug. in flexprop 5.9.23 I open a file, compile it and run it on P2_Kiss board.
    runs find with all expected results. Using the copy function of the file manager in Linux Mint Cinnamon copy and paste to another directory and I get the error shown in the scree shot attachment. Is this a problen with flexprop or with Linux Mint. Although I don't remember this being a problem with earlier versions of flexprop. It doesn't matter if I edit the program or just copy it to a new directory, the same compiler failure occurs.
    Jim

    The screen shot was missing. But in general I really doubt that this is a bug in Linux Mint, and it probably isn't one in flexprop either. More likely you've forgotten to copy some important file over, or else the program is relying on including an object (or header file) using a relative path.

  • When I have a missing obj, the compiler tells me in no un certain terms. I amsorry about the missing attachment. I have a couple of things I want to try and I will get back to you.
    Jim

  • I've released FlexProp 5.9.24 binaries on Patreon, and the sources are checked in to github. The major new change in this version is an option to create ZIP files from a project. There are also a number of bugfixes in the C library and an implementation of the C ungetc() function.

  • @ersmith said:
    I've released FlexProp 5.9.24 binaries on Patreon, and the sources are checked in to github. The major new change in this version is an option to create ZIP files from a project. There are also a number of bugfixes in the C library and an implementation of the C ungetc() function.

    :)

  • Heric,
    Here is the screenshot that I missed sending you. This was taken yesterday afternoon after doing a lot of recompiling and having everything work correctly to the final that suddenly cropped up with the error. Will install latest flexprop today and re-compile, then send you a zip of the program.
    Jim

  • Eric, here is a zipped file zipped by flexprop 5.9.24 that wont compile. I get the same error message as the earlier screen shot. I did notice that the error now has a line number which is the last line in the file. When I cut content out of the file the error moves up to the new last line.
    Jim

  • Jim:
    There were two bugs, one in my code in one in yours. FlexProp was getting the wrong line number for its error (and the error message wasn't as clear as it should be). The line number should have been line 165 or P2_RXRobot.1.spin2, which is the line:

               ser.printf(CR\LF)
    

    That line doesn't make any sense, as CR\LF means "use CR, then replace it with LF", but CR is a constant and cannot be replaced. I've fixed FlexProp so now it correctly reports the error:

    P2_RXRobot.1.spin2:165: error: left side of \ may not be constant
    

    I presume you probably meant to say something like ser.printf(string(CR, LF)) on that line.

  • Thank you Eric!
    Ok, I can live with my bugs when I know what they are. When will the update be avable that fixes your bug?
    Jim

  • ersmithersmith Posts: 6,036
    edited 2023-01-10 15:28

    It's checked in to github now, so if you update and rebuild from source you will get it.

Sign In or Register to comment.