ID:2218233
 
Not a bug
BYOND Version:510.1346, 511.1374
Operating System:Linux
Web Browser:Chrome 56.0.2924.87
Applies to:Dream Maker
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
Text after #include "foo.dm" is entirely ignored, and does not cause compiler errors or warnings.

Numbered Steps to Reproduce Problem:
Compile and run the below code

Code Snippet (if applicable) to Reproduce Problem:
mainfile.dme
#include "test.dm" SOME TEXT GOES HERE

/world/New()
world.log << "foo is [FOO]"
del(src)


test.dm
#define FOO 1


Expected Results: Compile failure at mainfile.dme:1

Actual Results: Compile success, prints "foo is 1" then exits, as if "SOME TEXT GOES HERE" wasn't present

Does the problem occur:
Every time? Or how often? Every time
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur? N/A

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Unknown

Workarounds: N/A

Lummox JR resolved issue (Not a bug)
There's nothing wrong with this behavior. It isn't necessary to produce an error here.
In response to Lummox JR
Lummox JR wrote:
There's nothing wrong with this behavior. It isn't necessary to produce an error here.

There's nothing wrong until you've killed an extra 5 or 10 minutes trying to figure out why, say, your server stopped appearing on the hub:

#include "test.dm" world/hub = "audeuro.test"


Whoops, that linebreak got destroyed...a warning would be nice, if nothing else.
Only 5-10? That's fairly mild.
Yeah, as Audeuro said, I spent a while figuring out why my code didn't have loop checks disabled, turned out I'd done:
#include "util.dm"/world/loop_checks = 0


No errors, no warnings, no disabled loop checks.
Figured I'd check GCC's behaviour when given similar input:

test.c
#define FOO 100


include.c
#include "test.c"FOO BAR

int main(void){
return FOO;
}


$ gcc -o include include.c
include.c:1:18: warning: extra tokens at end of #include directive
#include "test.c"FOO BAR
^

$ ./include

(exited 100) $
maybe you should make a feature request in the appropriate forum then