>>1 system("type filename > filename.tmp");
Not portable, therefore not enterprise
Name:
Anonymous2012-01-12 21:46
No buffer overflow prevention, therefore highly exploitable. What if ``filename'' was malicious machine code and you overflowed the buffer, causing malicious machine code to spill into the saved call point in memory, causing the code to run when the function returned? You're screwed.
>>5
What if the C implementation didn't use a single stack that retardedly places the return address at the point just past the end of the local variables?
Name:
Anonymous2012-01-12 22:15
>>5
C doesn't have a concept of stack, you should probably go back to /g/
>>17 C99 7.19.5.3.8 The fopen function returns a pointer to the object controlling the stream. If the open operation fails, fopen returns a null pointer.
So what happens if fopen() returns a NULL pointer and you call fgetc() on it? C99 7.1.4.1 Each of the following statements applies unless explicitly stated otherwise in the detailed descriptions that follow: If an argument to a function has an invalid value (such as a value outside the domain of the function, or a pointer outside the address space of the program, or a null pointer, or a pointer to non-modifiable storage when the corresponding parameter is not const-qualified) or a type (after promotion) not expected by a function with variable number of arguments, the behavior is undefined.
The Standard provides no exceptions for fgetc(), so it's undefined behavior.
>>29
I think it's a joke about how CMD.EXE replaces all Unicode characters with question marks, hence the type command. TYPE as in DOS's version of cat, not the Unix command
if is not a function. do is not a function. while is not a function. sizeof is not a function. (a + b) * c is not a function.
Since when do parenthesis imply functions?
Fucking autists.
Name:
Anonymous2012-01-13 7:07
>>39
It's not the parenthesis you stupid sack of shit, it's the spacing. Read K&R you dumb Jew.
Name:
Anonymous2012-01-13 7:21
>>40
I read it. It said ``functions have FUCK ALL to do with spacing and >>40 is such a flaming twink he makes Anal Touring look like Cassafuckinova.''
Since the implementation is allowed to whatever it wants with undefined and unspecified behavior I'm going to patch GCC to create executables that delete all your files when it detects undefined behavior.
Name:
Anonymous2012-01-13 7:25
>>42
I'm not from /g/, fuckface. Why don't you tell me what spacing has to do with functions.
>>52
Go back to /g/, retard, C doesn't have a stack.
Name:
Anonymous2012-01-13 10:57
>>44
You can read it in K&R you stupid piece of shit, it was even forced in the new edition of Perl but I can't expect your monkey ass to be intelligent enough to read rationale written by people who are infinitely more intelligent than you.
Name:
Anonymous2012-01-13 11:03
>>54 >>44 reminds of the idiot computer science major who didn't understand how fflush() worked. Presumably homer isn't bright enough to do the excercises in K & R. Otherwise he wouldn't have given a cynical response when someone provided the correct description to fflush(). Geeze, and then this jew wonders why he can't get a programming job.
Name:
Anonymous2012-01-13 11:23
>>52
C doesn't have a stack. A conforming implementation could implement all functions by inlining and function pointers by transforming them into the selector for a switch statement containing all valid values and inlining it (a pattern often used for state machines and interpreters). It could also use local static variables, garbage collection, or the heap for parameters and automatic variables, and use goto and heap-allocated linked lists for non-tail recursion. Some implementations transform automatic variables in non-recursive functions into static variables, some use a linked list of activation records allocated from a heap, and others use separate stacks for the return address, arguments, and local variables.
If C had an explicit stack, optimizations like tail-call elimination, register-based calling conventions, and automatic inlining would be illegal.