flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Include: displaying file name in the error message

Author
Thread Post new topic Reply to topic
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 20 Sep 2021, 14:35
Is there any reason why the error message “file not found” produced by the include directive doesn’t give any clues what file is not found?

I mean, I understand that the search logic is quite complicated and the “file not found” error is triggered when the file is not found in possibly multiple places (if the path specified is relative) but maybe displaying at least the parameter of the directive would be more informative.

It definitely is not a problem for the directive written in the code as is, since one can then see the exact file name required. But when the directive is produced by a pile of macros it might not be so obvious and the investigation requires running prepsrc and stuff.
Post 20 Sep 2021, 14:35
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 20 Sep 2021, 14:52
DimonSoft wrote:
Is there any reason why the error message “file not found” produced by the include directive doesn’t give any clues what file is not found?
The reason was that error message always shows the text of the line that caused the error, and because in fasm 1 INCLUDE expects a verbatim path (it cannot be a variable), the shown line is going to contain it anyway. This was the original logic behind this. In fasmg, where the path can be given through a variable value, the message shows the additional information about the path that was tried.

The case you mentioned, when the line is produced by macro, seems to indeed be problematic. I'm not sure why fasm does not show the preprocessed line then, perhaps it's something fixable...
Post 20 Sep 2021, 14:52
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 21 Sep 2021, 08:27
Sorry, I always forget that the main tool is fasm.exe, not fasmw.exe IDE, since I use the IDE almost always. For the command-line compiler it might be a bit better but in the IDE the line that originally caused the problem is highlighted and the “file not found” message is displayed with no additional info.

While highlighting the original line (not the one deep inside macros) is probably a good way to go, having it at least hint what the problematic file is would definitely be better than nothing.
Post 21 Sep 2021, 08:27
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.