Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

It doesn't compile?! Week 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;
}

Name: Anonymous 2010-09-26 10:27

What the fuck?

Name: Anonymous 2010-09-26 10:40

Isn't this a bit preschoolish?

Name: Anonymous 2010-09-26 10:40

[spoiler][m]#include <IHNBT[/spoier].h>[/m]

Shitty challenge; you're an idiot.

Name: Anonymous 2010-09-26 10:41

>>4
/IT DIDN'T COMPILE/

Name: Anonymous 2010-09-26 11:58

>>1
But it does compile! Unless you're using a Python compiler.

Name: Anonymous 2010-09-26 12:01

>>6
It doesn't. NULL is not defined unless you include void.h

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

Name: Anonymous 2010-09-26 12:26

works for gcc master race

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

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

Name: Anonymous 2010-09-26 14:50

>>1
There isn't anything called "NULL" in C.

Name: Anonymous 2010-09-26 14:53

>>12
You're wrong.

Name: Anonymous 2010-09-26 14:54

>>1
#define NULL  0
int main() {
    int *ptr = NULL;
    if( ptr == NULL )
        return 1;
    else
        return 0;
}

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;
}

Name: Anonymous 2010-09-26 15:15

NULL isn't a constant in c.

Name: Anonymous 2010-09-26 15:23

>>16
You're wrong.

Name: Anonymous 2010-09-26 16:43


int main() {
    int *ptr = NULL;
    return ( ptr == NULL ) ? 1 : 0;
}

Name: Anonymous 2010-09-26 16:47

>>18
int main() {
    int *ptr = NULL;
    return ptr == NULL;
}

Name: Anonymous 2010-09-26 16:47

>>19
int main() {
    return 1;
}

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?

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.

Name: Anonymous 2010-09-26 17:01

>>21
"Success" is a false concept

Name: Anonymous 2010-09-26 17:21

>>21
On some systems, EXIT_SUCCESS isn't 0.

Name: Anonymous 2010-09-26 18:43

>>21
because the domains are different.  OH WHY IS STDIN FD THE SAME AS FALSE DERP

Name: Anonymous 2010-09-26 18:50

>>22-25 HBT.
I thought that ``paradox'' gave it away.

Name: Anonymous 2010-09-26 18:55

>>26
You are too quick to throw that T around. I am having a good time !

Name: Anonymous 2010-09-26 19:45

>>26
yhbt

Name: Anonymous 2010-09-27 6:48

>>15
#define === ==
WHBT

Name: Anonymous 2010-09-27 11:06

>>29
no, you. [somebbcodeshit]Expert enterprise programmers[/somebbcodeshit] just ignored that post

Name: Anonymous 2010-09-27 11:31

>>30
Why would they ignore it

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.

Name: Anonymous 2010-09-27 12:35

>>32
That's because you're a loser.

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.

Name: Anonymous 2010-09-27 16:47

>>34
Thanks, I lol'd.

Name: Anonymous 2010-12-25 1:16

Name: Anonymous 2010-12-25 17:19

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List