TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Thomas Seeling
from: Vitus Jensen
date: 1999-01-22 00:51:44
subject: making dmake with emx 0.9d

Hello Thomas,

14.01.99 09:53, Thomas Seeling wrote a message to Mark Lewis:

 ml>> In file included from extern.h:66,
 ml>>                  from dmake.c:87:
 ml>> emx\public.h:161: conflicting types for `_chdir'
 ml>> H:\EMX\INCLUDE\stdlib.h:194: previous declaration of `_chdir'

 TS> identifiers should not begin with underscores, this is "reserved
 TS> namespace" in Ansi-/ISO-C. This is intended for compiler and
 TS> library writers who contribute to that particular compiler. 

Mark may safely remove the prototype of _chdir() from emx\public.h, it
isn't used.  _chdir2() is imported from the emx package, as is allows
changing directory *and* drive and DMake expects this behaviour.

#define	chdir		_chdir2

 TS> From the distance (I prefer Gnu make, not Dmake) I'd say that
 TS> dmake uses an internal function name of "_chdir" which is not
 TS> allowed since it may conflict with internal functions of the
 TS> runtime library. You hit one of those possibilities :)

DMake 4.0 supplies an own version of "change directory" when
compiled for systems/compilers which don't support that drive/dir change. 
See os2\_chdir.c or msdos\_chdir.c.
And BTW I prefer DMake, not GNU Make...


 ml>> the last two lines... they are saying that instead of...
 ml>>   PUBLIC void
 ml>>   main(argc, argv)

 ml>> that i should maybe have...
 ml>>   PUBLIC void
 ml>>   int main(argc, argv)
 TS> Remove the "void" after PUBLIC and make sure that the program
 TS> exits with a well-defined exit code. In Ansi-C (this is synonym
 TS> to ISO-C) main *must* return an int. Most time it works with
 TS> "void", and a lot of books teach it that way, but it is
 TS> definitely wrong. main() is called by the runtime environment of
 TS> the compiled program and is expected to return an exit code of
 TS> type "int".

Very stupid coding for a make utilitity which itself relies on exitcodes.
But it may comfort you (not much) that DMake always calls exit() which on
all systems I know works even with void main().  

C-x C-s
    Vitus

--- Sqed/rexx 393:
(2:2474/424.1)
* Origin: This copy of a human brain has been unregistered for 34 years
SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 635/444 506 728 639/252
SEEN-BY: 670/218
@PATH: 2474/424 400 200 2613/404 5 140/1 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™.