delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/14/01:41:11

From: pv AT cs DOT montana DOT edu (Paul Peavyhouse)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP inconsistencies?
Date: Thu, 13 Mar 97 13:44:53 GMT
Organization: Montana State University
Lines: 51
Message-ID: <5g9p1b$fac@netra.montana.edu>
References: <5g7p5i$abl AT netra DOT montana DOT edu> <01bc2fa7$9893d3c0$8c081ecb AT sly>
NNTP-Posting-Host: esus.cs.montana.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <01bc2fa7$9893d3c0$8c081ecb AT sly>, "Sly" <sly AT aussie DOT net> wrote:
>Paul Peavyhouse <pv AT cs DOT montana DOT edu> wrote in article
>>         char *str;
>>         if ( (str = getenv("DEM_PATH")) == NULL) {
>>                 printf("\"DEM_PATH\" environment variable not set\n");
>>                 exit(1);
>>         }
>> 
>
>That printf statement...is it a valid string in there?  Shouldn't it be...
>printf("DEMPATH environment variable not set\n");
>Or are you trying to put backslashes around it?  Like this...
>printf("\\DEMPATH\\ environment variable not set\n");
>Try these.  They should work.

         No, my printf statement IS perfectly legal (all I'm doing is have it 
print quotes around the DEM_PATH...don't ask why, it just works).  To prove my 
point I have completely commented it out, and I still have the same error.  
Here is a modified code:
 
DATAFILE *terra;

 int main (int c, char **v)
 {
         terra = load_datafile("terra.dat");
         char *str;
 }

        The funny thing is that if I write it as:

DATAFILE *terra;

 int main (int c, char **v)
 {
         char *str;
         terra = load_datafile("terra.dat");
 }

        ...IT WORKS?!?!?!  I can live with writing it this way, but I want to 
know why the compiler pukes when I write it the other way.  Can any help me 
here?  I'd appreciate it!

                                                                PV


______________________________________________________________________________

 Paul Peavyhouse                          
 http://www.cs.montana.edu/~pv           
 email: pv AT cs DOT montana DOT edu                
______________________________________________________________________________

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019