flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Preprocessor behaviour (bug?)

Author
Thread Post new topic Reply to topic
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 10 Jul 2007, 23:44
Look at this code
Code:
macro macro     {display "It is a macro"} ; No error at this point
macro struc arg {display "It is a struc"} ; No error at this point

struc struc{display "It is a real struc"} ; Does not invoke the macro struc above


a struc ; displays "It is a real struc"


struc ; Error: invalid name.
macro ; Error: invalid name.    


Shouldn't fasm do throw error immediately instead of allow definition of macroses that will not be callable later?
Post 10 Jul 2007, 23:44
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 11 Jul 2007, 01:35
looks like nice catch Smile
Post 11 Jul 2007, 01:35
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
cepers



Joined: 23 Jul 2007
Posts: 1
Location: MBIT.NET
cepers 23 Jul 2007, 21:40
ehhhmm....Very Happy
Post 23 Jul 2007, 21:40
View user's profile Send private message Yahoo Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 23 Jul 2007, 21:59
haha, thanks to cepers I remember that I forgot to tell that it actually happens with all the preprocessor directives. In the case of "common", "reverse" and "forward" it works well but if you call a macro with any of those names inside a macro the preprocessor will not call the macro but will interpret it as directive instead.
Post 23 Jul 2007, 21:59
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 09 Jul 2008, 15:09
bump
Post 09 Jul 2008, 15:09
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20301
Location: In your JS exploiting you and your system
revolution 09 Jul 2008, 16:25
Is this really a bug? It seems that if someone tries really hard to completely confuse themselves by doing this then they deserve all they get. Wink This seems more like a way of winning an obfuscation contest than writing real code.
Post 09 Jul 2008, 16:25
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 09 Jul 2008, 16:26
Is fixed for 1.67.28.

I'm un-stickying the threads with bug reports that already have resolved (even though the new version is not released yet). This helps me trace what is left to do, please do not make them sticky back.
Post 09 Jul 2008, 16:26
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 09 Jul 2008, 22:05
Quote:

Is fixed for 1.67.28.

Sorry for asking but, what are the news for the 1.67.27 version then? Razz

Quote:

This helps me trace what is left to do, please do not make them sticky back.


Good method Smile But note that I haven't make it sticky and I believe that it wasn't sticky when I bumped it. I had made sticky only the REPT bug.
Post 09 Jul 2008, 22:05
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 09 Jul 2008, 22:29
LocoDelAssembly wrote:
Quote:

Is fixed for 1.67.28.

Sorry for asking but, what are the news for the 1.67.27 version then? Razz

Ooops. I guess I forgot to release it. Very Happy
Post 09 Jul 2008, 22:29
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 10 Jul 2008, 07:31
OK, I will rename it back to 1.67.27 then. Twisted Evil
Post 10 Jul 2008, 07:31
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 11 Jul 2008, 08:04
Tomasz Grysztar wrote:
LocoDelAssembly wrote:
Quote:

Is fixed for 1.67.28.

Sorry for asking but, what are the news for the 1.67.27 version then? Razz

Ooops. I guess I forgot to release it. Very Happy


COOL Laughing Please look at the other BUG's: FASMD page fault, $0200-MZ bug (trivial) also Wink

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 11 Jul 2008, 08:04
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 08 Nov 2008, 14:11
I just realized it was not really so good idea to disallow using names of preprocessor's directives in ALL cases of defining preprocessor's symbols, because this way it included the FIX directive. This example from fasm's documentation:
Code:
    macro tmacro [params]
     {
      common macro params {
     }

    MACRO fix tmacro
    ENDM fix }    
is no longer working because of this "fix". I'm correcting it for the next release (1.67.29).
Post 08 Nov 2008, 14:11
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.