[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hi, this is student studying bash. (typeset question)
From: |
Chet Ramey |
Subject: |
Re: hi, this is student studying bash. (typeset question) |
Date: |
Tue, 29 Sep 2020 09:25:45 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 9/28/20 11:40 PM, ironhopper@projfrom.me wrote:
> but I cannot find the code related it. <integer variables were signed long,
> but now 64-bit>
Arithmetic expression evaluation is in expr.c.
> the question is
> <strong> where can I find integer type definition code? <strong>
Bash variable values are strings. Greg Wooledge already explained most of
how it works.
The integer attribute is declared here:
> #define att_integer 0x040 /* internal representation is int */
and tested using this macro (sometimes inline for compound tests):
> #define integer_p(var) ((((var)->attributes) & (att_integer)))
So if you search the source code for these identifiers, you'll find the
places integer variables are declared, set, and expanded.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/