[ragel-users] Wrong #line directive emitted when including files

Diego E. “Flameeyes” Pettenò flameeyes at gmail.com
Sun Sep 6 20:09:00 UTC 2009


I've been spending half an hour to find a build error in my code because
of this bug so here comes an useful testcase ;)

When including statemachines from multiple files, the #line directive
emitted in the .c file, which is used to report errors by gcc, is
_always_ referencing the converted .rl file. In the case of the testcase
I'm attaching (which is a reduced version of what I hit), gcc is going
to report an error in a line that is a comment:

flame at yamato testcase-bug-ragel % ragel test.rl
flame at yamato testcase-bug-ragel % gcc test.c -c
test.rl: In function ‘test’:
test.rl:9: error: ‘line’ undeclared (first use in this function)
test.rl:9: error: (Each undeclared identifier is reported only once
test.rl:9: error: for each function it appears in.)
flame at yamato testcase-bug-ragel % sed -n -e 9p test.rl 
 *


-- 
Diego Elio Pettenò — “Flameeyes”
http://blog.flameeyes.eu/

If you found a .asc file in this mail and know not what it is,
it's a GnuPG digital signature: http://www.gnupg.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: common.rl
Type: text/x-matlab
Size: 1359 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20090906/b9989ea2/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.rl
Type: text/x-csrc
Size: 321 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20090906/b9989ea2/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Questa è una parte del messaggio	firmata digitalmente
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20090906/b9989ea2/attachment-0001.sig>


More information about the ragel-users mailing list