I think your approach is wrong. You should not put the 'end' directive to more than one place in your source code. You could use #ifdef / #ifndef to leave out certain parts of your source code but leave the end directive to the very end. Btw, you can try "-DSOME_SYMBOL=3Dend" or "#SOME_SYMBOL end", and then just put the SOME_SYMBOL if you insist with your approach. Tamas On 30 June 2012 02:19, Peter wrote: > I post here since gpasm requires yet another mailing list subscription, > which I > do not have time to manage. I hope that this message will be forwarded to > the > gpasm maintainer(s). > > While using gpasm-0.14.1 (Mar 7 2012), a construct like: > > #ifdef SOME_SYMBOL > end > #endif > > fails with an error message along the lines of '#endif expected' (at end)= .. > This > is a bug imho, the #ifdef etc. is to be treated as a preprocessor > directive as > in C, and should issue at most a warning in this case. As it is, the > feature > prevents a test unit from being embedded in an asm file. The intent is to > be > able to assemble a test unit from the same source using a command line > switch > such as -DSOME_SYMBOL . The same unit can be assembled as > subroutine/library > without said symbol (or when defining another). > > I believe that the error caused by end encountered before an expected > #endif (or > several, should be a warning which should be promotable to an error, and > not an > error per se, around which there is no workaround. > > thanks, > Peter > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .