c++.dos.32-bits - DOSX Stack Alignment

When I run the DOSX program below on a plain DOS system (no HIMEM, etc), I
have found that the stack is not always aligned on a 32bit word boundary.
This results in slow performance times. If any command-line parameter is
entered when the program is executed, the stack is always aligned on a 32bit
word boundary.
I contacted Mr. Huffman in August, and he confirmed the results.
/*
** Compile: sc -mx test.c x32.lib
**
** Run on clean DOS machine.
** Execute with no commandline params for wrong alignment.
** example: test.exe
** Execute with commandline params for proper alignment.
** example: test.exe abc
*/
#include <stdio.h>
int main(int argc, char *argv[])
{
int i;
printf("\n&i=%p",&i);
printf("\n&argc=%p -- ",&argc);
i = (int)&argc;
if (i & 0x3)
printf("Not Aligned on 32bit word\n");
else
printf("Aligned on 32bit word\n");
return(0);

When I run the DOSX program below on a plain DOS system (no HIMEM, etc), I
have found that the stack is not always aligned on a 32bit word boundary.
This results in slow performance times. If any command-line parameter is
entered when the program is executed, the stack is always aligned on a 32bit
word boundary.
I contacted Mr. Huffman in August, and he confirmed the results.
/*
** Compile: sc -mx test.c x32.lib
**
** Run on clean DOS machine.
** Execute with no commandline params for wrong alignment.
** example: test.exe
** Execute with commandline params for proper alignment.
** example: test.exe abc
*/
#include <stdio.h>
int main(int argc, char *argv[])
{
int i;
printf("\n&i=%p",&i);
printf("\n&argc=%p -- ",&argc);
i = (int)&argc;
if (i & 0x3)
printf("Not Aligned on 32bit word\n");
else
printf("Aligned on 32bit word\n");
return(0);

-a4 is the default alignment for 32bit compilations. I added -a4 anyway and
the alignment problem remained. The problem is not with my program's
alignment, the problem is with the stack alignment when main() is called
from the x32 start up code.
Mr. Huffman has sent to me a patch of the x32 libraries, which seems to have
fixed the problem.
Jan Knepper wrote in message <3C177768.41E51A5F smartsoft.cc>...

When I run the DOSX program below on a plain DOS system (no HIMEM, etc),

have found that the stack is not always aligned on a 32bit word boundary.
This results in slow performance times. If any command-line parameter is
entered when the program is executed, the stack is always aligned on a

word boundary.
I contacted Mr. Huffman in August, and he confirmed the results.
<listing snipped>

When I run the DOSX program below on a plain DOS system (no HIMEM, etc), I
have found that the stack is not always aligned on a 32bit word boundary.
This results in slow performance times. If any command-line parameter is
entered when the program is executed, the stack is always aligned on a 32bit
word boundary.

Tested it and had the same behaviour when running with QEMM as memory
manager. Thank's for this hint.
Regards,
Heinz