atabac / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Give error if code has float but HAVE_FLOAT is disabled #168

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Building an image from code having a float in it using tools/pmImgCreator.py 
results in an improperly formed image if HAVE_FLOAT is not enabled.  Even 
worse, there is no warning that the image is corrupt.

I believe an error message should be given rather than an improperly built 
image.

Original issue reported on code.google.com by dwhall...@gmail.com on 27 Oct 2010 at 12:59

GoogleCodeExporter commented 9 years ago
Test by temporarily setting HAVE_FLOAT to false for PLATFORM=desktop::

ipm> a=4.0
AssertionError:Platform not configured with HAVE_FLOAT

Test by temporarily inserting a float constant in the PLATFORM=avr build::

../../tools/pmImgCreator.py -f pmfeatures.py -c -u --memspace=flash -o 
main_img.c --native-file=main_nat.c main.py ../../lib/avr.py
Traceback (most recent call last):
  File "../../tools/pmImgCreator.py", line 963, in <module>
    main()
  File "../../tools/pmImgCreator.py", line 957, in main
    pic.convert_files()
  File "../../tools/pmImgCreator.py", line 323, in convert_files
    imgs["imgs"].append(self.co_to_str(co))
  File "../../tools/pmImgCreator.py", line 491, in co_to_str
    s = self._seq_to_str(consts)
  File "../../tools/pmImgCreator.py", line 425, in _seq_to_str
    "Platform not configured with HAVE_FLOAT"
AssertionError: Platform not configured with HAVE_FLOAT
make[1]: *** [main_nat.c] Error 1

Original comment by dwhall...@gmail.com on 27 Oct 2010 at 4:49

GoogleCodeExporter commented 9 years ago
Made pmImgCreator.py give error if code has a float, but HAVE_FLOAT is disabled.

Original comment by dwhall...@gmail.com on 27 Oct 2010 at 4:50

GoogleCodeExporter commented 9 years ago
rc9e97dcc4759

Original comment by dwhall...@gmail.com on 27 Oct 2010 at 4:53