TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: All
from: Neil Heller
date: 1998-10-22 19:58:00
subject: #DEFINE(S)

Picture a function which expects to receive an integer as a formal
arguement.  Such a beast might have a prototype like:

void foo_func(int intvar);

Now picture a call to that function where a #define(d) integer
variable is passed, like:

#define GORTZ 38750;

int ramalamadingdong = GORTZ;

foo_func(ramalamadingdong);

No problem with a 32-bit compiler.  When I compile with a 16-bit
compiler however, I get a warning:

"truncation of constant value"

on the line where I call foo_func();.  I thought that truncation was
something that happened to character arrays, not integers.  From the
sound of that warning message I would expect ramalamadingdong to equal
3875, not the -5983 I'm expecting (32767 - 38750),  Am I expecting the
wrong thing?

 * KWQ/2 1.2i *

--- FLAME v1.1
* Origin: Port Chicago's Loading Dock - 510-676-5359 (1:161/204)
SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 810 639/252
SEEN-BY: 670/218
@PATH: 161/204 42 215/34 270/101 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.