Skip to content

Banning the usage of non-included procedures #55

@HuseyinSimsek7904

Description

@HuseyinSimsek7904

Let's imagine a scenario:

File library1.corth:

include "linux_x86/stdio.corth"

proc hello-world -> in
  "Hello, world!\n" puts
end

File library2.corth:

include "library1.corth"

File main.corth:

include "library2.corth"

proc main int int -> int in
  hello-world
end 0 end

In this program, main.corth is trying to call the hello-world procedure which is inside library1.corth. Compiler allows this behavior because library2.corth includes library1.corth. C/C++ compiler also allows this. However this is an unwanted "feature", because in Corth, every source file should include the source files that it needs and only the source files that it needs. So the compiler should to complain, or at least create a warning about this situation.

Metadata

Metadata

Labels

compilerAnything about the compilerdebugAnything about debuggingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions