It doesn't compile?! Week 1
1
Name:
Anonymous
2010-09-26 10:25
In spirit of the /prog/ challenges I will make my own.
I present to you: THE WEEKLY "IT DOESN'T COMPILE"
The challenge:
* Assess why the sourcecode doesn't compiles
* Determine what fixes there are for the problem
* Fix the problem with the appropriate patch
This week's challenge:
int main() {
int *ptr = NULL;
if( ptr == NULL )
return 1;
else
return 0;
}
2
Name:
Anonymous
2010-09-26 10:27
What the fuck?
3
Name:
Anonymous
2010-09-26 10:40
Isn't this a bit preschoolish?
4
Name:
Anonymous
2010-09-26 10:40
[spoiler] [m] #include <IHNBT[/spoier].h>[/m]
Shitty challenge; you're an idiot.
5
Name:
Anonymous
2010-09-26 10:41
6
Name:
Anonymous
2010-09-26 11:58
>>1
But it does compile! Unless you're using a Python compiler.
7
Name:
Anonymous
2010-09-26 12:01
>>6
It doesn't. NULL is not defined unless you include void.h
8
Name:
Anonymous
2010-09-26 12:06
$ g++ nul.cc -o nul
nul.cc: In function 'int main()':
nul.cc:3: error: 'NULL' was not declared in this scope
9
Name:
Anonymous
2010-09-26 12:26
works for gcc master race
10
Name:
Anonymous
2010-09-26 12:28
Windows doesnt care if main returns a non-zero int value, that is only recognized in *nix operating systems
11
Name:
Anonymous
2010-09-26 12:57
HIBT or
>>10 is just plain stupid? ERRORLEVEL exists for a reason. Windows also does support shit like aa || bb && cc
12
Name:
Anonymous
2010-09-26 14:50
>>1
There isn't anything called "NULL" in C.
13
Name:
Anonymous
2010-09-26 14:53
14
Name:
Anonymous
2010-09-26 14:54
>>1
#define NULL 0
int main() {
int *ptr = NULL;
if( ptr == NULL )
return 1;
else
return 0;
}
15
Name:
Anonymous
2010-09-26 15:14
#define function int
#define null 0
#define var int *
#define === ==
function main() {
var ptr = null;
if(ptr === null)
return 1;
else
return 0;
}
16
Name:
Anonymous
2010-09-26 15:15
NULL isn't a constant in c.
17
Name:
Anonymous
2010-09-26 15:23
18
Name:
Anonymous
2010-09-26 16:43
int main() {
int *ptr = NULL;
return ( ptr == NULL ) ? 1 : 0;
}
19
Name:
Anonymous
2010-09-26 16:47
>>18
int main() {
int *ptr = NULL;
return ptr == NULL;
}
20
Name:
Anonymous
2010-09-26 16:47
>>19
int main() {
return 1;
}
21
Name:
Anonymous
2010-09-26 16:53
>>20 reminds me of a paradox: Why is 0 the boolean false, but means EXIT_SUCCESS as an exit code?
22
Name:
Anonymous
2010-09-26 17:01
>>21
Because the question isn't "Were there no problems?", it's "Was there a problem?". Innocent until proven guilty.
23
Name:
Anonymous
2010-09-26 17:01
>>21
"Success" is a false concept
24
Name:
Anonymous
2010-09-26 17:21
>>21
On some systems,
EXIT_SUCCESS isn't 0.
25
Name:
Anonymous
2010-09-26 18:43
>>21
because the domains are different. OH WHY IS STDIN FD THE SAME AS FALSE DERP
26
Name:
Anonymous
2010-09-26 18:50
>>22-25 HBT.
I thought that ``paradox'' gave it away.
27
Name:
Anonymous
2010-09-26 18:55
>>26
You are too quick to throw that T around. I am having a good time
!
28
Name:
Anonymous
2010-09-26 19:45
29
Name:
Anonymous
2010-09-27 6:48
30
Name:
Anonymous
2010-09-27 11:06
>>29
no, you. [somebbcodeshit]Expert enterprise programmers[/somebbcodeshit] just ignored that post
31
Name:
Anonymous
2010-09-27 11:31
>>30
Why would they ignore it
32
Name:
Anonymous
2010-09-27 11:37
This thread has been closed and replaced with the following thread:
Subject: Compiling BitC code with a C compiler
Name:
Email:
It doesn't work.
33
Name:
Anonymous
2010-09-27 12:35
>>32
That's because you're a loser.
34
Name:
Anonymous
2010-09-27 14:17
This thread has been closed and replaced with the following thread:
Subject: Compiling BitC code with a BitC compiler
Name:
Email:
It doesn't work.
35
Name:
Anonymous
2010-09-27 16:47
36
Name:
Anonymous
2010-12-25 1:16
37
Name:
Anonymous
2010-12-25 17:19