08 June 2023, 06:24 | #1 |
Registered User
Join Date: May 2023
Location: Christchurch, New Zealand
Posts: 33
|
SAS/C 6/58 printf() no prototype
I do not understand;
Code:
#include <stdio.h> int main() { printf("Hello World\n"); return 0; } Code:
SAS/C Amiga Compiler 6.58 Copyright (c) 1988-1995 SAS Institute Inc. ==================== printf[(]"Hello World\n"); print.c 4 Warning 100: no prototype declared for function "printf" Slink - Version 6.58 Copyright (c) 1988-1995 SAS Institute, Inc. All Rights Reserved. SLINK Complete - Maximum code size = 7560 ($00001d88) bytes Final output file size = 7568 ($00001d90) bytes Code this simplistic shouldn't produce this error and I'm trying to fix it before I do anything more meaningful, it should be said that the code at least on my system runs and works as expected regardless of the prototype error, however warnings can often be an indication that something is wrong and can lead to problems in time. |
08 June 2023, 08:53 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
It's just a warning that you aren't checking the return code of printf().
|
08 June 2023, 17:54 | #3 | |
Registered User
Join Date: Mar 2019
Location: Poland
Posts: 59
|
Quote:
Such warning appears when compiler cannot find the correct prototype for a function - perhaps the included stdio.h file is incorrect or damaged. I compiled this code on my amiga and i did not get any warning. |
|
09 June 2023, 00:47 | #4 |
Registered User
Join Date: Jan 2021
Location: Darksideofthemoon
Posts: 69
|
deleted!
i checked if a wrong assignment could cause that, but then no executable will be build. i'm sure, i encountered this in the past as well. Last edited by freakofnature; 09 June 2023 at 01:03. |
09 June 2023, 14:27 | #5 |
Registered User
Join Date: Aug 2012
Location: Champaign IL USA
Posts: 22
|
The compiler might be finding an unexpected file named stdio.h in its header search path. Try running only the preprocessor (sc pponly print.c), then check the output.
Robert |
19 June 2023, 08:53 | #6 | |
Registered User
Join Date: May 2023
Location: Christchurch, New Zealand
Posts: 33
|
Quote:
I checked my stdio.h to see if was corrupted, hoping it wasn't there and ... it is just as it has always been for decades lol. stdio.h extern int printf(const char *, ...); Just spitballin here, couldn't be because of an updated os? Am I missing a required .lib? -- according to snoopdos maybe an issue with sc.lib ? maybe a compiler option? I'm using "sc <sourcefile> link <outputfile>" ? Last edited by Inner200k; 19 June 2023 at 09:13. |
|
19 June 2023, 10:14 | #7 |
old bearded fool
Join Date: Jan 2010
Location: Bangkok
Age: 56
Posts: 775
|
I get no warning when compiling your source code using 'sc hello_world.c'.
How does your SAS/C assigns look (check with 'assign' in shell)? In my s:Startup-Sequence (actually User-Startup in my case) the following lines were added: Code:
;BEGIN SAS/C assign sc: sys:programs/sasc assign lib: sc:lib assign include: sc:include assign cxxinclude: sc:cxxinclude path sc:c add ;END SAS/C |
19 June 2023, 10:24 | #8 | ||
Registered User
Join Date: May 2023
Location: Christchurch, New Zealand
Posts: 33
|
Quote:
Quote:
|
||
19 June 2023, 10:29 | #9 |
Registered User
Join Date: May 2023
Location: Christchurch, New Zealand
Posts: 33
|
I fixed up my assigns ... that was the issue! goodness.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SAS/C 6.58 on 1.3 | marduk_kurios | Coders. C/C++ | 25 | 29 July 2018 18:17 |
SAS C 6.58 (again) | nyteshade | request.Other | 2 | 15 December 2016 17:18 |
Using AHI dev with SAS/C 6.58 | 8bitbubsy | Coders. General | 5 | 09 August 2011 02:50 |
Sas C 6.58 | AmiCoder | request.Apps | 3 | 06 February 2010 01:19 |
SAS C/C++ 6.58 manual? | ableeker | Coders. General | 15 | 23 October 2008 22:05 |
|
|