Re: FLEX, was Re: Return value of malloc(0)
On Thu, 2006-Jun-29 15:09:23 -0700, Randall Hyde wrote: How about feeding the C source through the preprocessor, stripping out the #line directives, compiling it and posting the exact gcc error and source context. Okay, I'll try that when I get home. But I was kind of under the impression that *GCC* runs the preprocessor on the input, during compilation :-). It does but, as you pointed out, the input line you posted doesn't obviously correlate with the error report. Explicitly pre-processing the source and stripping out the #line directives means that you can then correlate the error message with the actual line that cc1 is compiling. -- this would appear to be a generic problem with using FLEX output under BSD and I thought a quick question would affirm/deny that thought. Well, I just did a check of some flex code I have lying around and it did not report any syntax errors or unexpected warnings. And, since flex is used several times during a buildworld, any generic problems would show up very quickly. -- Peter Jeremy pgpgHVxdRwirz.pgp Description: PGP signature
Re: FLEX, was Re: Return value of malloc(0)
On Wed, Jun 28, 2006 at 10:40:45PM -0700, Randall Hyde wrote: Without seeing the code or the actual error message, I'm guessing the answer is 42. Perhaps, some detail might be appropriate. I seriously doubt seeing the code will do much good. Here's the offending line: YY_INPUT( (yy_current_buffer-yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); Hopefully, people who use your product give better bug reports. I don't know whether I should laugh or cry. gcc -DfreeBSD -c -o lex.yy.o lex.yy.c and it stops with syntax error before numeric constant. Does your code include all the required header files? This looks like a namespace pollution problem. -- Steve ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FLEX, was Re: Return value of malloc(0)
On Wed, 2006-Jun-28 22:40:45 -0700, Randall Hyde wrote: I seriously doubt seeing the code will do much good. Here's the offending line: YY_INPUT( (yy_current_buffer-yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); How about feeding the C source through the preprocessor, stripping out the #line directives, compiling it and posting the exact gcc error and source context. It may be a gcc bug, it may be a HLA bug or it could be an interaction between the FreeBSD headers and HLA. -- Peter Jeremy pgpp9mRIaGDPu.pgp Description: PGP signature
Re: FLEX, was Re: Return value of malloc(0)
Randall Hyde [EMAIL PROTECTED] BTW, if anyone is intrested in the full FLEX source, it's part of the HLA (High Level Assembler) source package found here: http://webster.cs.ucr.edu/AsmTools/HLA/HLAv1.84/hlasrc.zip Just wondering if those guys knew that IBM calls their mainframe assembler the High Level Assembler, which they abbreviate HLASM. This isn't an x86 assembler like HLA - it's a z/Architecture (mainframe) assembler, very different beast indeed. But - they may want to pick a new name, lest they incur the wrath of IBM's lawyers. I think IBM took that name in the 80s. Also - it seems that 'webster.cs.ucr.edu' has gone missing from DNS somehow; so I wasn't able to look at the source, although I was able to look at the web pages thanks to Yahoo's cache. - Dave Rivers - -- [EMAIL PROTECTED]Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FLEX, was Re: Return value of malloc(0)
-Original Message- How about feeding the C source through the preprocessor, stripping out the #line directives, compiling it and posting the exact gcc error and source context. Okay, I'll try that when I get home. But I was kind of under the impression that *GCC* runs the preprocessor on the input, during compilation :-). It may be a gcc bug, it may be a HLA bug or it could be an interaction between the FreeBSD headers and HLA. None of the code listed has *anything* to do with the HLA.FLX source (and certainly nothing to do with the rest of the HLA source code). It is quite possible that some FreeBSD headers conflict with this section of the FLEX output (remember, this is *canned* output code from FLEX, this is not generated in response to any FLEX input code). That's why my original question was so generic and not specific -- this would appear to be a generic problem with using FLEX output under BSD and I thought a quick question would affirm/deny that thought. Cheers, Randy Hyde ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FLEX, was Re: Return value of malloc(0)
-Original Message- From: Thomas David Rivers [EMAIL PROTECTED] Sent: Jun 29, 2006 3:17 AM To: freebsd-hackers@freebsd.org, [EMAIL PROTECTED] Subject: Re: FLEX, was Re: Return value of malloc(0) Randall Hyde [EMAIL PROTECTED] BTW, if anyone is intrested in the full FLEX source, it's part of the HLA (High Level Assembler) source package found here: http://webster.cs.ucr.edu/AsmTools/HLA/HLAv1.84/hlasrc.zip Just wondering if those guys knew that IBM calls their mainframe assembler the High Level Assembler, which they abbreviate HLASM. These guys would be just me, and I'm quite aware of HLASM. Of course, the term High Level Assembler predated IBM's HLASM by many years (indeed, the phrase was used a bit in the late 1960s, see Salomon's book for details). This isn't an x86 assembler like HLA - it's a z/Architecture (mainframe) assembler, very different beast indeed. Yes, their concept of High Level meant fancy macro facilities. Not back for a 1980's-era assembler. But - they may want to pick a new name, lest they incur the wrath of IBM's lawyers. I think IBM took that name in the 80s. Again, the generic term High Level Assembler predated HLASM, and HLA and HLASM are two different things. Further, there was an HLA for the Amiga some time back. Again, it's not like this term is terribly original. And I seriously doubt if IBM really cares at this point. Also - it seems that 'webster.cs.ucr.edu' has gone missing from DNS somehow; so I wasn't able to look at the source, although I was able to look at the web pages thanks to Yahoo's cache. Hmmm... Webster is a relatively famous site, so that's unusual. Cheers, Randy Hyde ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
FLEX, was Re: Return value of malloc(0)
Without seeing the code or the actual error message, I'm guessing the answer is 42. Perhaps, some detail might be appropriate. I seriously doubt seeing the code will do much good. Here's the offending line: YY_INPUT( (yy_current_buffer-yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); This is from static int yy_get_next_buffer() Which is part of the canned code that comes with FLEX. Compiles just fine under Linux. Linux has a slightly newer version of GCC, but I've been compiling this code on Windows (Borland and VC++) as well as Linux for years without a problem (i.e., older versions of GCC). BTW, if anyone is intrested in the full FLEX source, it's part of the HLA (High Level Assembler) source package found here: http://webster.cs.ucr.edu/AsmTools/HLA/HLAv1.84/hlasrc.zip I compiled the FLEX code with the command line: flex -8 -i hla.flx This works fine, then I compile the GCC output with gcc -DfreeBSD -c -o lex.yy.o lex.yy.c and it stops with syntax error before numeric constant. As this code is in part of the FLEX-supplied C code, I would think that this problem would be independent of my particular flex code. BTW, I've tried using both the FLEX I use on Linux under BSD as well as the BSD-supplied version. I've even taken the FLEX output from freeBSD and compiled it under Linux (it compiles successfully. I'm using GCC 3.3.5 under Linux, 3.4.4 under BSD. Any known problems with 3.4.4 that would cause this? cheers, Randy Hyde ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]