NO

Author Topic: Software development in c  (Read 14570 times)

CommonTater

  • Guest
Re: Software development in c
« Reply #15 on: June 16, 2012, 04:36:32 PM »
Actually, I don't even know if and how many people are aware about this 3rd parameter of the main() function. But Google returns a bloated load of links mentioning it, when searching for "environment variables enumeration in c". In that sense, it certainly won't hurt if Pelles C would support it too ;)

Then you should put in a feature request ... Write up a little article demonstrating the need and see what happens. :D   Pelle is very good about saying "yes" or "no" to these things, which is as it should be.
« Last Edit: June 16, 2012, 04:38:54 PM by CommonTater »

migf1

  • Guest
Re: Software development in c
« Reply #16 on: June 16, 2012, 04:44:33 PM »
Actually, I'm not concerned that much about Pelles C's support of envp, because I use mingw gcc along with Pelles.
I only mentioned it for the shake of completeness, regarding main(), because it's quite common on most c-platforms, or at least on the most popular among them.

PS. What kinda bothers me though, is the fact that I cannot close poIDE tabs by double-clicking on them (this I will officially file it as a feature request, but I have to search that it is not already filed).

CommonTater

  • Guest
Re: Software development in c
« Reply #17 on: June 16, 2012, 04:52:07 PM »
Actually, I'm not concerned that much about Pelles C's support of envp, because I use mingw gcc along with PS. What kinda bothers me though, is the fact that I cannot close poIDE tabs by double-clicking on them (this I will officially file it as a feature request, but I have to search that it is not already filed).

Try right clicking on the tabs...

I'd rather they not close on double clicks, as a safety measure against accidental closures.

migf1

  • Guest
Re: Software development in c
« Reply #18 on: June 16, 2012, 04:58:27 PM »

Try right clicking on the tabs...

I'd rather they not close on double clicks, as a safety measure against accidental closures.
Right-clicking works just fine, but it slows me down so much :)
Of course I'll request it as an optional addition to the current behavior.

PS. I've hi-jacked the topic :P

migf1

  • Guest
Re: Software development in c
« Reply #19 on: June 16, 2012, 05:14:31 PM »
PS. I've hi-jacked the topic :P

Since I've already done it  ;D , allow me to abuse it a little bit more: does version 7.00rc3 come without any pre-installed addons? I installed it today on my Win7 64bit machine and it didn't have any.

CommonTater

  • Guest
Re: Software development in c
« Reply #20 on: June 16, 2012, 05:17:45 PM »
PS. I've hi-jacked the topic :P

Since I've already done it  ;D , allow me to abuse it a little bit more: does version 7.00rc3 come without any pre-installed addons? I installed it today on my Win7 64bit machine and it didn't have any.

Install the AddIn SDK as well... you'll get a couple of extra wizards and addins in the bargain.

migf1

  • Guest
Re: Software development in c
« Reply #21 on: June 16, 2012, 05:23:17 PM »
Cool, thanks :)


Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Software development in c
« Reply #22 on: June 16, 2012, 05:59:45 PM »
Anyway, the only reason for suggesting its addition was in the case Pelle wanted Pelles C to be more compatible with MS c-runtime.
What M$ C runtime? Microsoft has pretty much abandoned C, caring only about their C++?Ccrap stuff...

Pelle's C is pretty much the only serious plain C compiler out there, and his intentions seems to to adhere to the C standards, which is perfectly fine...

Ralf

migf1

  • Guest
Re: Software development in c
« Reply #23 on: June 16, 2012, 06:09:23 PM »
What M$ C runtime? Microsoft has pretty much abandoned C, caring only about their C++?Ccrap stuff...

That's so very true!

However, VC++, C++ Builder and MinGw are very (very) popular and by default they use the MS C runtime. I thought it would be nice if Pelles could give those users one more reason to make the switch ;)

Quote
Pelle's C is pretty much the only serious plain C compiler out there, and his intentions seems to to adhere to the C standards,...

Ralf

No question about that!
« Last Edit: June 16, 2012, 06:11:47 PM by migf1 »

czerny

  • Guest
Re: Software development in c
« Reply #24 on: June 16, 2012, 06:58:25 PM »
Yeap, as I mentioned it is not standard C. However, modern posix, ms and macos-x all support it.

PS1. Not a bad idea for Pelle to also support it in future versions, too ;)

If I remember right, I had to port a third party library. In such cases it would be very handy to have this option or the POSIX variant.

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: Software development in c
« Reply #25 on: June 16, 2012, 09:39:40 PM »
The main entry point signature is described as to support the environment block at The main Function and Program Execution at MSDN.

Since we are developing for Windows, we should have the ability to use the official signature of the main function.
---
Stefan

Proud member of the UltraDefrag Development Team

migf1

  • Guest
Re: Software development in c
« Reply #26 on: June 16, 2012, 11:28:01 PM »
...
In such cases it would be very handy to have this option or the POSIX variant.

Starting from the msdn main() link presented by Stefan Pendl, I just discovered that a corresponding char **_environ global var is also present in the MS C runtime, via <stdlib.h> (along with its wide variant, _wenviron): http://msdn.microsoft.com/en-us/library/stxk41x1%28v=vs.80%29.aspx

Although it is clearly marked as depreciated at msdn, I just tested it with the latest mingw gcc and it works just fine...

Code: [Select]
#include <stdio.h>
#include <stdlib.h>

int main( void )
{
    extern char **_environ;
    char **env = _environ;

    while ( *env )
        puts( *env++ );

    system( "pause" );
    exit(0);
}

Pelles C doesn't support it though.

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: Software development in c
« Reply #27 on: June 17, 2012, 12:03:32 AM »
After taking a closer look the third parameter seems to be M$ VS/VC specific.

Anyways this would just be the environment block state at the start of the program, which can easily be retrieved by the GetEnvironmentStrings function.
---
Stefan

Proud member of the UltraDefrag Development Team

migf1

  • Guest
Re: Software development in c
« Reply #28 on: June 17, 2012, 12:08:48 AM »
After taking a closer look the third parameter seems to be M$ VS/VC specific.

Yeap, it's not standard C.
But it is supported by most major c dev platforms (windows, posix, macos).

Quote
Anyways this would just be the environment block state at the start of the program, which can easily be retrieved by the GetEnvironmentStrings function.

Yes, CommonTater also pointed it out.