Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#204 closed defect (fixed)

Add sanity checking on foreign import

Reported by: erikd Owned by: erikd
Priority: normal Milestone:
Component: Source Semantics Version: 0.1.2
Keywords: Cc:

Description

Currently the compiler accepts this:

foreign import "1.0" unboxedOneFloat64 :: Float64#

which is unnecessary (can be replaced with unboxedOneFloat64 = 1.0#f64).

Other things like:

foreign import "(Char32)" whatever

seems to be required when compiling the interface file.

Change History (4)

comment:1 Changed 9 years ago by erikd

Basically, anything between the double quotes should be a valid C identifier that matches the regular expression:

[_a-zA-Z][_a-zA-Z0-9]+

Casts like "(Char32)" should be replaced with a macro in runtime/Macro.h.

This can probably be fixed in the parser.

comment:2 Changed 9 years ago by erikd

  • Owner set to erikd
  • Status changed from new to assigned

comment:3 Changed 9 years ago by erikd

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in this commit

Fri Dec 24 10:44:13 EST 2010  Erik de Castro Lopo <erikd@mega-nerd.com>
  * Source.Lint : Only accept valid identifiers in foreign imports.

comment:4 Changed 8 years ago by benl

  • Milestone 0.1.3 deleted

Milestone 0.1.3 deleted

Note: See TracTickets for help on using tickets.