aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 [2]

Author Topic: hum Revision 9783  (Read 10143 times)

wires

  • Jr. Member
  • **
  • Karma: 6
  • Offline Offline
  • Posts: 83
Re: hum Revision 9783
« Reply #15 on: September 03, 2009, 09:46:51 PM »

Hi all,

I'm also using GCC 4.4.1 (on Fedora 11 64bits) but I'm able to compile both provided and generated versions... (aMule-SVN-r9783-RELEASE-2_2_X)
Quote
$ gcc --version
gcc (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2)
Copyright (C) 2009 Free Software Foundation, Inc.
Quote
$ grep fwrite php_lexer.c
 * we now use fwrite().
#define ECHO fwrite( yytext, yyleng, 1, yyout )
Quote
$ flex --version
flex 2.5.35

I've noticed that there is no php prefix but yy.  Don't know if it is important...

I can make some tests if you wish. Find attached the generated php_lexer.c.

Regards!


Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: hum Revision 9783
« Reply #16 on: September 04, 2009, 01:41:49 AM »

Code: [Select]
#define ECHO (void) fwrite( phptext, phpleng, 1, phpout )

That's definiately not what we want. At least on my system the above #define is included in a #ifndef ECHO block, which is defined in php_parser.h included before the test. That's why it works.

However, since ECHO is a token of the language and is used for something completely different by the generated code we should consider renaming the token to something else not conflicting with flex.
Logged
concordia cum veritate

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: hum Revision 9783
« Reply #17 on: September 04, 2009, 11:33:33 AM »

btw thats the part how my "self" compiled stuff looks like

Code: [Select]
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO do { if (fwrite( phptext, phpleng, 1, phpout )) {} } while (0)
#endif

should this file be in most cases static? so basically always use the one from svn?
or should we want this file be generated on most linux systems and only be static if requirements are not met, and on windows?
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: hum Revision 9783
« Reply #18 on: September 04, 2009, 09:09:32 PM »

At least on my system the above #define is included in a #ifndef ECHO block, which is defined in php_parser.h included before the test. That's why it works.
Yes, finally understood it. Only - why doesn't it work for Stefanero?  ???
Stefanero, is something wrong with your php_parser.h ? Like the #define ECHO missing or not processed or whatever?

Quote
However, since ECHO is a token of the language and is used for something completely different by the generated code we should consider renaming the token to something else not conflicting with flex.
Agreed. And we should backport it to 2.2.6 before the problem spreads.

should this file be in most cases static? so basically always use the one from svn?
I'd say everybody should use the generated code. Generation should only occur if someone modifies the lex file (and who does that should be able to figure out possible problems with his lexer himself  :) ).
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: hum Revision 9783
« Reply #19 on: September 05, 2009, 01:12:07 PM »

And we should backport it to 2.2.6 before the problem spreads.
Completely agreed. I'll do it tonight.
Logged
concordia cum veritate

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: hum Revision 9783
« Reply #20 on: September 07, 2009, 04:30:00 PM »

btw works like a charm in current svn now :D
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: hum Revision 9783
« Reply #21 on: September 07, 2009, 10:27:21 PM »

Nice to hear.
Logged
concordia cum veritate
Pages: 1 [2]