www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/02/15:17:15

Message-Id: <3.0.5.32.19990102175801.007ab6c0@200.252.238.1>
X-Sender: thiagofga AT 200 DOT 252 DOT 238 DOT 1 (Unverified)
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32)
Date: Sat, 02 Jan 1999 17:58:01 -0200
To: djgpp AT delorie DOT com
From: "Thiago F.G. Albuquerque" <thiagofga AT ambr DOT com DOT br>
Subject: __ctr0_glob_function() doesn't get called in C++
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Hi,

The documentation says one could disable the command line wildcard
expansion by providing a __ctr0_glob_function() that always returned NULL.
But I found out this only works with C source files. This can be tested
this way:

#include <stdio.h>

char **__crt0_glob_function(char *_argument)
{
 printf("This is __crt0_glob_function\n");
 return NULL;
}

int main(int argc, char *argv[])
{
 int i;
 for(int i=0; i<argc; i++)
      printf("%s\n", argv[i]);

 return 0;
}

save this as glob.c, compile it and run. Then rename the source file to
glob.cpp and rebuild it. You will notice the C version prints the message,
while the C++ doesn't.

Is there a way around this?

Thiago Albuquerque

- Raw text -


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