Article View: comp.sys.sun
Article #7041HELP! What's wrong with my program?
From: Hong Ye
Date: Mon, 18 Mar 1991 17:28
Date: Mon, 18 Mar 1991 17:28
33 lines
1331 bytes
1331 bytes
Following piece of code looks to be perfectly innocent. It runs perfectly
on Sun-3 indeed. But it produces weird results on Sun-4 and DEC2100. I
guess the compiler on Sun-4 or DEC uses a different calling convention.
Could anybody tell me what I am doing wrong? Please reply through mail.
#include <stdio.h>
#define argA 0xAAAAAAAA
#define argB 0xBBBBBBBB
#define argC 0xCCCCCCCC
main() {
printf("Original:\n");
printf("\t%08X\n\t%08X\n\t%08X\n",argA,argB,argC);
fake_printf(argA,argB,argC,0);
} /* main */
fake_printf(args)
int args;
{
internal_printf(&args);
} /* fake_printf */
internal_printf(args)
int *args;
{
printf("Inside Printf:\n");
while (*args) {
printf("\t%08X\n",*args);
args++;
}
} /* internal_printf */
Technical Details
Message-ID:
<1968@brchh104.bnr.ca>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: ye@henri.ucsb.edu (Hong Ye) Newsgroups: comp.sys.sun Subject: HELP! What's wrong with my program? Keywords: Miscellaneous Message-ID: <1968@brchh104.bnr.ca> Date: 18 Mar 91 17:28:00 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 33 Approved: Sun-Spots@rice.edu X-Original-Date: 2 Mar 91 01:28:28 GMT X-Sun-Spots-Digest: Volume 10, Issue 57, message 4 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu