Page MenuHomeFeedback Tracker

[Function Preprocessor Bug] Line numbers not correct in functions with #include
New, NormalPublic

Description

The function preprocessor is broken. The line numbers are incorrect.

It's because no #LINE directive is added for the define (#LINE 1 "PATH\define.hpp). Instead, the start of the script is put right after the define (#LINE 1 "PATH\fn_someFnc.sqf")

See the steps to reproduce and additional details.

preprocessorFileLineNumbers works fine.

Details

Severity
Major
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
Engine
Steps To Reproduce

Create a function in description.ext. Put this EXACT code in it (it contains errors but it's for testing):

#include "defines.hpp"
//line2
//line3
//line4
"This should be line 5" BUT ITS LINE10

contents of defines.hpp:

#define A 1
#define B 2
#define C 2
#define D 2
#define E 2
Additional Information

This is the contents of the test function after preprocessing:

{
	private _fnc_scriptNameParent = if (isNil '_fnc_scriptName') then {'TEST_fnc_TEST'} else {_fnc_scriptName};
	private _fnc_scriptName = 'TEST_fnc_TEST';
	scriptName _fnc_scriptName;

#line 1 "TEST\fn_TEST.sqf [TEST_fnc_TEST]"









"This should be line 5" BUT ITS LINE10}

Event Timeline

Leopard20 created this task.Nov 4 2020, 7:15 PM
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)
Leopard20 edited Additional Information. (Show Details)
Leopard20 edited Additional Information. (Show Details)Nov 4 2020, 7:18 PM
Leopard20 updated the task description. (Show Details)Nov 4 2020, 7:33 PM