Bizarre macro bug.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bizarre macro bug.

Iain Duncan
Got everything working again, but discovered this. In the orchestra the
following does not work, I get a no legal opcode message for the first
undef call after the second outch line. Ie:

code:
        instr 501
#define TRACK #1#
#define MIXTRIM #1#
#define AUX_NUM #1#
#include "mixer/drum_mixer2.orc"
;* send out the main signal
  outch 1, asigL * $MIXTRIM
  outch 2, asigR * $MIXTRIM
#undef MIXTRIM
#undef TRACK
#undef AUX_NUM
  endin

I get:
no legal opcode #undef MIXTRIM.

Inserting an extra carriage return after the outch fixes it, the below
is fine.
       
        instr 501
#define TRACK #1#
#define MIXTRIM #1#
#define AUX_NUM #1#
#include "mixer/drum_mixer2.orc"
;* send out the main signal
  outch 1, asigL * $MIXTRIM
  outch 2, asigR * $MIXTRIM

#undef MIXTRIM
#undef TRACK
#undef AUX_NUM
  endin

This is strange because the code used to work fine without that extra
return. Hope that is somewhat useful.

Iain


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: Bizarre macro bug.

jpff
Sounds like a typical parse problem in seeing the #undef
==John ffitch


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: Bizarre macro bug.

Istvan Varga
In reply to this post by Iain Duncan
Iain Duncan wrote:

> Got everything working again, but discovered this. In the orchestra the
> following does not work, I get a no legal opcode message for the first
> undef call after the second outch line. Ie:

Well, now with an example I was actually able to fix the bug.
It was triggered only if the #undef (or possibly any other
preprocessing statement starting with #) occured on the line
following a macro expansion at the end of the previous line
without a '.' or any other trailing characters.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: Bizarre macro bug.

Iain Duncan


Istvan Varga wrote:

> Iain Duncan wrote:
>
>> Got everything working again, but discovered this. In the orchestra
>> the following does not work, I get a no legal opcode message for the
>> first undef call after the second outch line. Ie:
>
>
> Well, now with an example I was actually able to fix the bug.
> It was triggered only if the #undef (or possibly any other
> preprocessing statement starting with #) occured on the line
> following a macro expansion at the end of the previous line
> without a '.' or any other trailing characters.

Thanks. Sorry for the delay in the example. It was part of a very large
project so it took a bit of effort to isolate the point at which it was
failing while making sure it wasn't just me being a bonehead. ;)

Iain


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel