Andrew Collier | 8 Jun 2005 08:27
Picon
Picon

format in m4

hello,

i have come across something unexpected using 'format' with m4. i am wanting to just trim off the decimal
portion of a number. however, when the 'trimmed' number ends with zeros these get removed as well. for example:

m4_format(`%.0f', 293408.883333)
m4_format(`%.0f', 293409.883333)
m4_format(`%.0f', 293499.883333)

which produces:

293409
29341
2935

so, the first line works fine. the second and third lines do not produce what i expected at all. i thought that
maybe i had misunderstood the implementation of 'format', so i coded the above in c:

printf("%.0f\n", 293408.883333);
printf("%.0f\n", 293409.883333);
printf("%.0f\n", 293499.883333);

and in this case i get precisely what i wanted:

293409
293410
293500

i am using GNU m4 1.4.1.

(Continue reading)

Hans Aberg | 11 Jun 2005 18:49
Picon
Picon

M4 version macro

Does M4 have a macro, expanding to its version number (I suspect 
not)? This might be useful when using M4 to generate parser/lexer 
files in Bison/Flex, and stamp them with the M4 version used, so it 
becomes clearly visible in debug reports.
--

-- 
   Hans Aberg
Bartosz "Chojny" Chojnicki | 13 Jun 2005 21:38
Picon
Favicon

(no subject)

Hi!
It's imposible to me to emerge m4 on a gentoo linux. I attached config.log
--

-- 
Bartosz "Chojny" Chojnicki
Linux Registered User #344460
Jabber ID: chojny <at> chrome.pl
gg: 4283414
Attachment (config.log): text/x-log, 6576 bytes
_______________________________________________
Bug-m4 mailing list
Bug-m4 <at> gnu.org
http://lists.gnu.org/mailman/listinfo/bug-m4
Bartosz "Chojny" Chojnicki | 14 Jun 2005 00:19
Picon
Favicon

(no subject)

ups it was my mimstake, sorry for bodering you.
--

-- 
Bartosz "Chojny" Chojnicki
Linux Registered User #344460
Jabber ID: chojny <at> chrome.pl
gg: 4283414
Gary V. Vaughan | 17 Jun 2005 11:10
Picon
Gravatar

Re: M4 version macro

Hallo Hans,

Hans Aberg wrote:
> Does M4 have a macro, expanding to its version number (I suspect not)? 
> This might be useful when using M4 to generate parser/lexer files in 
> Bison/Flex, and stamp them with the M4 version used, so it becomes 
> clearly visible in debug reports.

CVS M4 (soon to be m4-2.0) has __m4_version__.

Release versions of GNU m4 could use syscmd(`m4 --version') if PATH is
set reasonably...

Cheers,
	Gary.
--

-- 
Gary V. Vaughan      ())_.  gary <at> {lilith.warpmail.net,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Gmane