Questions tagged [c89]

This tag is for questions regarding the international standard ISO 9899:1990, also known as "C89", "C90" or "ANSI C", with amendments and technical corrigenda (as opposed to K&R C, C99, C11 or later C standard revisions).

The first C standard was released 1989 nationally in USA, by their national standard institute ANSI. This release is called C89 or ANSI-C. One year later, the American standard was accepted internationally and published by ISO (ISO 9899:1990). This release is called C90. Technically, it is the same standard as C89/ANSI-C, though formally, C90 replaced C89/ANSI-C, making them obsolete.

Always use the tag for all your C questions, then complement it with the tag for questions that are specific to this version of the standard.

643 questions
0
votes
1 answer

Learning about MsBuild project files for Compiling Ansi C90

The following main wants to be compiled via msbuild #include int main (int argc, char *argv[]) { char Buffer[2000]; printf("TEST"); gets(Buffer); } A Batch file calls…
Johannes
  • 6,490
  • 10
  • 59
  • 108
0
votes
1 answer

printf access violation in subfunction - Ansi C90

A call to printf inside a subfunction results in an Access Violation. The program is quite huge in size. but i was able to isolate the problem to the point where only the subfunction call is made. i am able to crash the system by calling printf with…
Johannes
  • 6,490
  • 10
  • 59
  • 108
0
votes
1 answer

File won't compile in MS Visual Studio, but will in GCC. Why?

I wrote such sample code: #include #include #include #include #include char* print_errno_msg(int value); int main(void){ struct stat buffer; int status; status = stat("./main.c",…
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
0
votes
3 answers

Using WinAPI & DWMApi in ANSI C

I've got a question regarding writing applications for Windows. Can I use WinAPI and DWMApi (aero glass, ribbon, etc.) when programming in ANSI C? I'm looking at MSDN right now and they use c++.
Lucas
  • 99
  • 1
  • 4
0
votes
2 answers

Problems with a structure copy

I am having a compiler issue in Visual Studio 2005 using the standard C compiler when trying to do a structure copy from one location to another. The types are defined in a file as follows: definition.h #define MAX 7 typedef struct{ char …
0
votes
2 answers

Why is it undefined to derefrence a pointer to extern union?

I have the following code. Why its undefined to derefrence union pointers in the following way ? extern union MyUn *P1; extern union MyUn *P2; extern void myfunc(void) { *P1 = *P2; }
bubble
  • 3,408
  • 5
  • 29
  • 51
0
votes
2 answers

What is the difference between Integral Promotion and Balancing in C?

What is the difference between integral promotion and balancing. Can we sum up both the rules by saying that any type is converted to atleast int or unsigned int type before performing any operation(except logical operators &&, ||, !) and to a…
bubble
  • 3,408
  • 5
  • 29
  • 51
0
votes
1 answer

Is "true" (lower case) already a keyword in visual studio? Can it be overridden?

I am using the visual studio 2005 C++ compiler (but are coding using C89 type ANSI C) and am unable to define a "true" and "false" keyword to use as follows: #define true 1 #define false 0 I have used this exact code successfully using the Green…
0
votes
3 answers

Combining comparison tests within a control flow statement in ANSI C

I am trying to remember if, using a standard c compiler (C89), the two if statements below will evaluate in the same way. snippet 1: boolean function(formattype* format) { if(format != null && (*format == format1 || *format == format2 || *format…
0
votes
2 answers

MSVC 10.0 c vs c++ differences

I'm having difficulty compiling the C program below, It's just the begining of me trying to understand winsock. The issue is that when compiling the program client.c, I get an error (C2143) missing ';' before 'type' But when I re-name the source…
0
votes
1 answer

High level - interpreted language in C89

I need any high level language interpreter written in C89. What are my options? I would like to take the language and possible extend it to support some of the low level OS dependent functionality of the host platform. The interpreted language…
Ayman
  • 11,265
  • 16
  • 66
  • 92
0
votes
1 answer

default argument promotions in the case of inplicit function declarations

I've tried to search in old questions but I've not solved my problem. I try to explain my doubt; Supposing to work in c89 mode, if there's not a prototype of the function before the function call, there is an implicit declaration of the function,…
abc
  • 11,579
  • 2
  • 26
  • 51
0
votes
2 answers

How to define and use a struct without full struct definition in header?

For controling struct members and force programmers to use getter/setter functions, I want to write code like below pattern: /* Header file: point.h */ ... /* define a struct without full struct definition. */ struct point; /* getter/setter…
Amir Saniyan
  • 13,014
  • 20
  • 92
  • 137
-1
votes
1 answer

Various issues while dealing with files -C90

The problem(actually various problems): if choice != 0 either the insert_text function is called or add_word_in_dictionary is called which is not wanted.. I want to create a function which saves a file.Thus, I created the save_file function but I…
George S
  • 51
  • 7
-1
votes
3 answers

Is the GCC option -Wdeclaration-after-statement purely stylistic?

Is the option -Wdeclaration-after-statement stylistic only? By that I mean, if I macro'd all cases in my C code where a variable was defined and I initialized them in them in the same fashion migrating from this older style C90 to the newer C99…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468