Integer variables in older versions of Bash were signed long (32-bit)
integers, in the range of -2147483648 to 2147483647. An operation that
took a variable outside these limits gave an erroneous result.
but I cannot find the code related it. <integer variables were signed
long, but now 64-bit>
I downloaded bash source files on websites.
versions are bash-1.14.7, bash-2.05a, bash-2.05b, and bash-5.0
and now comparing each versions.
the question is
<strong> where can I find integer type definition code? <strong>
I found some code like below.
-- variables.h -- version 2.05b
/* For the future */
union _value {
char *s; /* string value */
intmax_t i; /* int value */
COMMAND *f; /* function */
ARRAY *a; /* array */
HASH_TABLE *h; /* associative array */
double d; /* floating point number */
void *v; /* opaque data for future use */
};
-- variables.h -- version 2.05a
/* The various attributes that a given variable can have. */
#define att_exported 0x001 /* export to environment */
#define att_readonly 0x002 /* cannot change */
#define att_invisible 0x004 /* cannot see */
#define att_array 0x008 /* value is an array */
#define att_nounset 0x010 /* cannot unset */
#define att_function 0x020 /* value is a function */
#define att_integer 0x040 /* internal representation is int */
#define att_imported 0x080 /* came from environment */
#define att_local 0x100 /* variable is local to a function */
#define att_tempvar 0x200 /* variable came from the temp environment
*/
#define att_importstr 0x400 /* exportstr points into initial environment
*/
It's my first time to find some code from the whole big program like
bash.
It's very interesting and exciting work but also very difficult as
beginner's view.
if possible, Would you let me know the file name which gnu team usually
set the configurations like type definitions?(projects structure)
someday studying more and more, I want support many other gnu projects!
Thank GNU for everything we use.
Sincerely, ironhopper(nickname).