The Anonix Project (126, permasaged)

1 Name: Cudder !MhMRSATORI!!L0f5nl0+ : 2008-05-10 06:41 ID:apPW4NZm This thread was merged from the former /code/ board. You can view the archive here.

Since 4chan's /prog/ has become little more than meme spamming, I decided I'd try here.

Me and a group of anons are working on a POSIX-compliant OS, which will be developed anonymously and be public domain. Currently we've started on replacing GNU's Coreutils with Anoncoreutils, and have around 1/3 of the utilities finished. This is both an experiment in anonymous software development and an attempt to eliminate the bloat that GNU's programs tend to have.

Anyone is welcome to join in with this, as long as they don't leave a name and don't mind writing code for the public domain.

More info at http://rechan.eu.org/ac/ and http://rechan.eu.org/ax/

2 Name: #!/usr/bin/anonymous : 2008-05-10 09:11 ID:Heaven

Go away.

You've stolen someone else's tripcode, you're posting with a name so you aren't anonymous, your code quality is terrible and you don't seem to understand the first thing about proper software development, and for the love of god stop spamming your crappy board everywhere.

3 Name: #!/usr/bin/anonymous : 2008-05-10 09:16 ID:Heaven

>>2
I see 4chan's /prog/ is starting to spill over in here.

4 Name: #!/usr/bin/anonymous : 2008-05-10 09:24 ID:Heaven

>>3
No memes used in >>2. Truth is truth regardless of the board it's posted on.

5 Name: #!/usr/bin/anonymous : 2008-05-11 10:22 ID:Heaven

>>1

>to eliminate the bloat that GNU's programs tend to have

:facepalm:

go kill yourself

6 Name: #!/usr/bin/anonymous : 2008-05-11 10:49 ID:EBhnW3dO

>>5
You used a meme. Your argument is invalid.

7 Name: #!/usr/bin/anonymous : 2008-05-11 12:42 ID:Heaven

MEMES EVERYWHERE

8 Name: #!/usr/bin/anonymous : 2008-05-11 14:48 ID:Heaven

>>5
I don't get it. Are you denying that GNU's programs have bloat? I'm not challenging you, I seriously don't get it.

9 Name: #!/usr/bin/anonymous : 2008-05-11 16:30 ID:qbgZMpW+

>>7
in b4 hax my anus, grabs dick, instant.exe, etc.

10 Name: #!/usr/bin/anonymous : 2008-05-11 16:56 ID:omYbeO/h

>>9
Meme this! grabs dick

11 Name: #!/usr/bin/anonymous : 2008-05-11 17:00 ID:rjOJuAmw

Ah, little Cudder. Give up, you seek helpers not where you are supposed to. But then, people at serious programming forums will laugh at your futile attempt at doing something big.

Drop it. I don't want to see you fail.

12 Name: fusian asian : 2008-05-11 17:16 ID:Heaven

>>11

> Drop it. I don't want to see you fail.

Yes, you do. Don't deny it.

13 Name: #!/usr/bin/anonymous : 2008-05-11 17:16 ID:Heaven

>>8

>I don't get it. Are you denying that GNU's programs have bloat? I'm not challenging you, I seriously don't get it.

Are you claiming cat, echo, pwd etc. suffer from bloat? How so?

You can't be fucking serious.

14 Name: #!/usr/bin/anonymous : 2008-05-11 17:22 ID:Heaven

I don't really see what Anonix would contribute other than being some half-assed hackjob of an OS.
Would be better if just sat down and made an editor so we don't have to resort to 70's abandonware.

15 Name: Anonymous : 2008-05-11 17:32 ID:Heaven

hax my anus

16 Name: #!/usr/bin/anonymous : 2008-05-11 17:47 ID:Heaven

>>14
Please, don't mention that.

17 Name: #!/usr/bin/anonymous : 2008-05-11 19:35 ID:q77PlXka

hax my anus

18 Name: #!/usr/bin/anonymous : 2008-05-11 19:48 ID:Heaven

>>13
Heh. Maybe not those...

19 Name: dmpk2k!hinhT6kz2E : 2008-05-11 20:47 ID:Heaven

If you're after small utilities, what's wrong with BusyBox?

This wheel was invented and refined long ago.

20 Name: #!/usr/bin/anonymous : 2008-05-11 21:59 ID:Heaven

Forget your stupid OS! I'm gonna make my own with hookers and blackjack! In fact, forget the OS!

21 Name: #!/usr/bin/anonymous : 2008-05-11 23:08 ID:MtV0H+jp

>>1,13
You have asserted that the GNU tools are "bloated" without further qualifying that statement. I really don't understand why you'd want to reimplement all of GNU coreutils. GNU isn't supposed to be the epitome of Posix programming, it's first goal is to be a free system.

22 Name: HAHAHaruhi!6mHaRuhies : 2008-05-12 03:25 ID:apPW4NZm

>>19
We're not just after small and efficient. BB is GPL, we're going for public domain and small and efficient.

>>13,21

  • GNU cat has 11 more options than POSIX requires, and if you read the spec, at the bottom it says that those options were omitted from the standard because they can be duplicated with sed.
  • For echo, POSIX specifies that ``implementations shall not support any options'' while GNU's version has 4.
  • GNU pwd has two options, but they are not the two that POSIX requires. (We'll probably move pwd into bash though)

We are not reimplementing the GNU coreutils, we are writing POSIX utilities which just so happen to be included in the GNU coreutils. As the Anonix plan indicates, our goal is to develop a public-domain (even more free than GPL, slightly more free than BSD, and anonymous) POSIX implementation.

23 Name: dmpk2k!hinhT6kz2E : 2008-05-12 04:21 ID:Heaven

> public domain

I hope none of your contributors live in the US. If some do I recommend you either do a wee bit more research about the legal situation of public domain code, or they stop contributing.

Why do you think MIT/X11 licences and the like exist?

As an aside, I make regular use at work of echo's -n and -e options (albeit you don't need -n with -e). But if you like life on the spartan side, go for it; UNIX is a pile of crap as is.

24 Name: #!/usr/bin/anonymous : 2008-05-12 05:28 ID:EBhnW3dO

>>23
It is commonly believed by non-lawyers that it is impossible to put a work into the public domain. Although copyright law generally does not provide any statutory means to "abandon" copyright so that a work can enter the public domain, this does not mean that it is impossible or even difficult, only that the law is somewhat unclear. Congress may not have felt it necessary to codify this part of the law, because abandoning property (like a tract of land) to the public domain has traditionally been a matter of common law, rather than statute. (Alternatively, because copyright has traditionally been seen as a valuable right, one which required registration to achieve, it would not have made sense to contemplate someone abandoning it in 1976 and 1988.)[1]

[1] Public domain - Wikipedia, the free encyclopedia. Retrieved on May 12, 2008.

25 Name: #!/usr/bin/anonymous : 2008-05-12 08:25 ID:Heaven

>>22

>GNU cat has 11 more options than POSIX requires, and if you read the spec, at the bottom it says that those options were omitted from the standard because they can be duplicated with sed.

So, what's going to be a worse waste of resources when you need one of those options? Just running "extended" cat, or running both cat and sed? And how much waste are we actually talking about here? Have you ever sat down and done the math? What platform are you targeting that this would actually gain you something?

Surely you'll have pondered these questions before undertaking such an ambitious project.

26 Name: #!/usr/bin/anonymous : 2008-05-12 11:51 ID:Heaven

>>25
If they want to waste their time, then let them. I just wish they'd contribute their efforts to more important problems like free replacements of proprietary programs like Flash or BIOSs.

27 Name: #!/usr/bin/anonymous : 2008-05-12 15:22 ID:BJgX08VW

>>22
hmm, I use echo's -n (don't print a trailing newline) option on BSD all the time. Don't know how I'd write my little hacks and things without it.

28 Name: #!/usr/bin/anonymous : 2008-05-12 18:32 ID:Heaven

Retarded thread is retarded.

29 Name: dmpk2k!hinhT6kz2E : 2008-05-12 19:39 ID:Heaven

>>24

> only that the law is somewhat unclear

Tada.

30 Name: #!/usr/bin/anonymous : 2008-05-13 00:22 ID:apPW4NZm

>>27
Technically POSIX doesn't consider -n to be an option, but it does do what you'd think it should.

31 Name: #!/usr/bin/anonymous : 2008-05-13 08:01 ID:Heaven

>>27

ECHO(1)                 FreeBSD General Commands Manual                ECHO(1)

NAME
echo -- write arguments to the standard output

...

     -n    Do not print the trailing newline character.  This may also be
achieved by appending `\c' to the end of the string, as is done by
iBCS2 compatible systems. Note that this option as well as the
effect of `\c' are implementation-defined in IEEE Std 1003.1-2001
(``POSIX.1'') as amended by Cor. 1-2002. Applications aiming for
maximum portability are strongly encouraged to use printf(1) to
suppress the newline character.

32 Name: !w4lolitaKs : 2008-05-13 08:47 ID:Heaven

To those wondering about the inexact nature of "public domain", here's the official "license" we're going to use:

Permission is hereby granted, free of charge, to any person obtaining
this work (the "Work"), to deal in the Work without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Work, and to permit
persons to whom the Work is furnished to do so.
THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS IN THE WORK.

33 Name: #!/usr/bin/anonymous : 2008-05-13 15:42 ID:Heaven

"Talk is cheap. Show me the code."

Linus Torvalds

34 Name: #!/usr/bin/anonymous : 2008-05-13 16:01 ID:U7Lxd9fk

In the EU that license might be equivalent to the (new) BSD license because you cannot abandon certain reputation rights (such as the right to sue someone for using your name, or removing your name from something). In order to effectively do so, you may want to consult a lawyer about including a clause promising not to enact reputation acts where they may exist.

Also: The Berne Convention makes it pretty clear that copyright is implicit and automatic. You may also want to have a lawyer add a clause that says (something to the effect of) "The author(s) intend no additional restrictions in use, except those restrictions that cannot be abandoned by law."

Also: WIPO and the Ninth Circuit Court in the US disagree on whether something whose copyright has been abandoned can be copyrighted someplace else. It is for this reason that many lawyers recommend against using the words "public domain" when referring to a living document with many authors.

Finally, if you're not actually interested in talking to a lawyer, I'd recommend selecting a license that does what you intend. The http://www.opensource.org/licenses has lots of licenses to choose from. It may be a lot easier to start with (for example) the old X.net license, instead of trying to cook up a new one.

35 Name: #!/usr/bin/anonymous : 2008-05-13 16:23 ID:Heaven

> It may be a lot easier to start with (for example) the old X.net license, instead of trying to cook up a new one.

Hey, if their whole project is a case of NIH, why not the license too?

36 Name: HAHAHaruhi!6mHaRuhies : 2008-05-14 06:43 ID:apPW4NZm

>>33
http://rechan.eu.org/misc/anoncoreutils/

that's just what we've got since the last update (beginning of May, there'll probably be another one around the beginning of June)

>>35
I think the license we're using is actually the MIT one with some stuff taken out.

>such as the right to sue someone for using your name, or removing your name from something

The thing is, the authors of Anonix have specifically chosen not to use names; or as close as the name Anonymous can convey, anyway.

37 Name: dmpk2k!hinhT6kz2E : 2008-05-14 18:16 ID:Heaven

While I don't understand what you're trying to achieve by rewriting utilities anonymously, I don't want to discourage you from pursuing it. It's a better way to spend your time than a number of things I can think of.

However, I'd like to know why are you posting with a nick and tripcode if you believe enough in the dogma of "Anonymous" to be doing this.

As an aside, your CFLAGS should contain -Wall. Always. In fact -Wall isn't enough, since there are a number of warnings that it doesn't cover, including: -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Winline --Wredundant-decls

38 Name: #!/usr/bin/anonymous : 2008-05-15 01:39 ID:Heaven

>>37
Doesn't -Wall -W cover all of that? Or at least most.

My usual CFLAGS is -Os -g -ansi -pedantic -Wall -W -Werror.

39 Name: dmpk2k!hinhT6kz2E : 2008-05-15 15:45 ID:Heaven

Unfortunately, they don't.

There are a lot of flags that are more troublesome than they're worth, but the Perl and FreeBSD projects make use of the above listed ones.

-Wall -Wextra (the -W) is pretty good though.

I used to play with Splint as a counterpart to GCC's warnings. It's extremely paranoid though: http://www.splint.org/

40 Name: HAHAHaruhi!6mHaRuhies : 2008-05-15 23:03 ID:Heaven

>However, I'd like to know why are you posting with a nick and tripcode if you believe enough in the dogma of "Anonymous" to be doing this.

We are just the planning group; the code submissions themselves are anonymous.

>>37-39
I believe in ``trust the programmer'', i.e. I know what I'm doing, and if I make a mistake I'm smart enough to figure out what it is; IMHO relying on warnings just offloads too much thought to the (dumb) machine. Other anons working on the project may have their own preferences.

41 Name: #!/usr/bin/anonymous : 2008-05-15 23:25 ID:Heaven

>>40
Your code has bugs. end of story.

42 Name: dmpk2k!hinhT6kz2E : 2008-05-16 00:05 ID:Heaven

You can't be serious, >>40.

Why are you using GCC then? For that matter, why are you using a compiler at all? Hand-compile it!

Machines are good at precision. Humans aren't. You are a complete and utter idiot if that's the reason you don't make use of the tools available to you. You're not a superhuman omniscient entity, regardless of your ego.

Do you believe profilers, debuggers, tests and QA aren't for Real Manly Man Programmers too?

43 Name: #!/usr/bin/anonymous : 2008-05-16 08:31 ID:EBhnW3dO

>>42
I lold
at what a retarded faggot you are

44 Name: #!/usr/bin/anonymous : 2008-05-16 09:08 ID:Heaven

``Anonix'' is quite a succesful trolling endeavor it seems.

45 Name: #!/usr/bin/anonymous : 2008-05-16 14:50 ID:Heaven

bad topic

46 Name: #!/usr/bin/anonymous : 2008-05-16 15:43 ID:n5BHpUt7

>LULZ
> LULZ

47 Name: #!/usr/bin/anonymous : 2008-05-16 17:11 ID:Heaven

Does anonix have jisshin/kashin model?

48 Name: #!/usr/bin/anonymous : 2008-05-16 23:11 ID:Heaven

>>47
I don't think so. These people have said nothing about that. Also, you now need a T-Engine processor to implement these things.

49 Name: Anonymous : 2008-05-16 23:47 ID:Heaven

Ha ha ha. 4-ch has made a better work at trolling you, cdr.

50 Name: HAHAHaruhi!6mHaRuhies : 2008-05-17 04:31 ID:Heaven

>>42
Writing everything in Asm would defeat the portability we're striving for with POSIX. I only know x86 and Z80 Asm.

If you think you can't write perfect code, then you will just accept your imperfection and remain reliant on the compiler/IDE/etc to do your thinking. However, if you constantly strive for perfection, you will come pretty damn close to achieving it. Many are surprised by this, but the key is in thinking very carefully about design before writing a single line of code, and not just throwing things at the compiler until it works.

>>41
I can't tell you which of the anoncoreutils I've written, but all the stuff I've written has no bugs after I'm done. Give me a small unrelated-to-Anonix (solvable) programming problem and I'll write 100% correct code for it.

>>47
wut

51 Name: #!/usr/bin/anonymous : 2008-05-17 08:19 ID:Heaven

whbt, whl. /code/, let's move on.

52 Name: #!/usr/bin/anonymous : 2008-05-17 08:29 ID:Heaven

>>50
write a program that outputs the integer square root of strtoimax(argv[0], NULL, 0) in O(1) time.

53 Name: #!/usr/bin/anonymous : 2008-05-17 11:19 ID:Heaven

Mac  ...a princess and servants
Anonix ...a sadist and masochists
Win  ...a tyrant and slaves

BTRON...a tool and a human

http://4-ch.net/code/kareha.pl/1142746101/

54 Name: #!/usr/bin/anonymous : 2008-05-17 11:29 ID:mYin4QJj

>>53
Vaporware is not a human.

55 Name: HAHAHaruhi!6mHaRuhies : 2008-05-18 01:33 ID:Heaven

>>52
The sqrt of its own name? If you really want that...

#include <math.h>
#include <stdio.h>
#include <inttypes.h>
main(int argc, char **argv) {
printf("%.0Lf\n",floorl(sqrtl((long double)strtoimax(argv[0], NULL, 0))));
}

I'm assuming sqrtl() uses the h/w instruction, which should run in constant time on any CPU made since the early 90s.

56 Name: #!/usr/bin/anonymous : 2008-05-18 06:12 ID:Heaven

>>55
No mister Bond, what you assume is that a intmax_t fits in a long double, which is a false assumption and can lead to program bugs.
Since you didn't define main as a function returning int and rather, you let it be implied, you are not working with C99 but rather C89 and thus you don't have or strtoimax.
You have FAILED.

57 Name: #!/usr/bin/anonymous : 2008-05-18 07:29 ID:Heaven

>>56
Find me an implementation where sizeof(intmax_t) > sizeof(long double).

He(she?) didn't specify the compile options, I tested the code and it works with GCC on a system where sizeof(long double)=12 and sizeof(intmax_t)=8. Including inttypes.h will give you strtoimax(), and as long as libc is C99 compliant it will have the functions as well. >>52 never said anything about what the program should return, so that is irrelevant.

58 Name: #!/usr/bin/anonymous : 2008-05-18 10:40 ID:Heaven

>>56,57
I'm a bit more worried about the argv[0] used here. I don't think it's a very useful input.

59 Name: #!/usr/bin/anonymous : 2008-05-18 11:23 ID:Heaven

>>58
Would be useful if you had wildcard symlinks. (lolwut?)

But I agree, the original problem wasn't that useful anyway; man bc

60 Name: #!/usr/bin/anonymous : 2008-05-18 13:01 ID:Heaven

WTF who needs a licence? JUST USE NONE! (and stay anonymous

61 Name: #!/usr/bin/anonymous : 2008-05-18 17:54 ID:Heaven

>>57
Since the program uses C99 functions, it should conform to C99. That program does not conform to C99 because main is not defined as a function returning int.
As for an implementation where sizeof (intmax_t) > sizeof (long double), even if sizes have nothing to do with it, try lcc-win.
Just because it works on one system means shit.
Look, clearly you and >>55 know shit-all about C, so seriously.

62 Name: #!/usr/bin/anonymous : 2008-05-18 20:49 ID:Rsls/Psh

>>52 here...
>>58
the argv[0] was used because i thought maybe HAHAHaruhi would change it to argv[1], which would be a bug.

but there are other bugs as well:
first...

$ gcc -lm -o hahafail hahafail.c
/var/tmp//ccBv2HKb.o(.text+0x41): In function `main':
: undefined reference to `sqrtl'

second... an intmax_t value is not guaranteed to fit in a long double.

63 Name: HAHAHaruhi!6mHaRuhies : 2008-05-19 01:16 ID:apPW4NZm

>>62

# cat loltest.c
#include <math.h>
#include <stdio.h>
#include <inttypes.h>
main(int argc, char **argv) {
printf("%.0Lf\n",floorl(sqrtl((long double)strtoimax(argv[1], NULL, 0))));
}
# gcc -o loltest -s -Os -lm loltest.c
# gcc --version
gcc (GCC) 4.0.3
...

>>61
It doesn't matter, the code itself is valid C89 and I happen to have C99 libs to link against. If you want it to work on your system then tell me what your type sizes are. And as for main() not returning int, see section 5.1.2.2.3 of the C99 std. "If the return type is not compatible with int, the termination status returned to the host environment is unspecified" -- that's fine, since >>52 didn't say anything about what it should return.

>>52, why don't you show us what you'd write? And as an extra challenge, write fold as per http://www.opengroup.org/onlinepubs/009695399/utilities/fold.html but ignore everything related to internationalisation.

64 Name: #!/usr/bin/anonymous : 2008-05-19 01:41 ID:Heaven

Careful, >>52. HAHAHaruhi is trying to get you to write a piece of his project.

65 Name: #!/usr/bin/anonymous : 2008-05-19 02:53 ID:Rsls/Psh

> It doesn't matter, the code itself is valid C89 and I happen to have C99 libs to link against.

sqrtl isn't in C89 or POSIX. either use C99 or don't.

> If you want it to work on your system then tell me what your type sizes are.

sizeof(long double) is 3
sizeof(intmax_t) is 8
CHAR_BIT is 32.

> >>52, why don't you show us what you'd write?
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>

#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
#error Please use a compiler that supports the C99 standard to compile this file.
#endif

intmax_t isqrt(intmax_t n){
intmax_t r = 0;
if(0 > n) n = -n;
for(intmax_t i = ~(INTMAX_MAX >> 2) & INTMAX_MAX / 3; i; i >>= 2)
if(n >= (i | r)){
n -= i | r;
r = r >> 1 | i;
} else r >>= 1;
return r;
}

int main(int argc, char *argv[]){
intmax_t n = strtoimax(argv[0], NULL, 0);
printf("%" PRIdMAX "%s\n", isqrt(n), 0 > n ? "i" : "");
return 0;
}

66 Name: #!/usr/bin/anonymous : 2008-05-19 03:16 ID:Heaven

I bet >>52-san is doing this just to show off his OMG OPTIMIZED integer sqrt function.

67 Name: #!/usr/bin/anonymous : 2008-05-19 05:03 ID:Heaven

>>63
YOU FUCKING IDIOT GOD DAMMIT
TRYING TO REFERENCE THE C99 STANDARD TO ME?!?!?!? LLOLOLL
The paragraph you quoted is not even related as it talks about an implicit return, not implicit int.
Look at 5.1.2.2.1 Program Startup. See that you are wrong.

The function called at program startup is named main. The implementation declares no
prototype for this function. It shall be defined with a return type of int and with no
parameters:
int main(void) { /* ... */ }
or with two parameters (referred to here as argc and argv, though any names may be
used, as they are local to the function in which they are declared):
int main(int argc, char *argv[]) { /* ... */ }

No, the code itself is not valid C89.
Fail harder kiddo.

And yes, I can write fold and in fact I've written fold. But you're just trying to make me write something for you.

68 Name: Cudder !MhMRSATORI!!L0f5nl0+ : 2008-05-19 12:39 ID:Heaven

Hmm... you forgot the fourth or-part of the 5.1.2.2.1 clause.

>or in some other implementation-defined manner.
>No, the code itself is not valid C89.
$ gcc -std=c89 -c abcxyz.c
$ ls abcxyz.o
abcxyz.o
$

lolwut? with -Wall there's a 'return type defaults to int' warning, but I guess that was to be expected. Works fine after linking with -lm.

BTW, aCU has fold already, it was finished several days ago. Wait until the June update, or if you really want proof I can post the source here.

Now defer any assessments of the abilities of the Anonix programmers until the June update; also, regarding the "X isn't c-whatever-standard" or "X won't work on a system with Y" complaints; for the former, all we're concerned is that the utilities do what the POSIX spec says, and for the latter -- do you have such a system where it won't work? No? Non-existent systems don't matter. Even Linux started out being i386-only.

69 Name: #!/usr/bin/anonymous : 2008-05-19 13:46 ID:Heaven

>>68
That's for freestanding implementations, you really don't know your shit.
The code is not valid C89. You lied about gcc's output, because you didn't even include the math library! You blatant liar!
http://www.schweikhardt.net/identifiers.html
intmax_t -> C99. Just deal with it, your code is not valid C89.
And lastly, yes, post the source here. Or give us a link to the source. So I can show you how many errors you have.
Your remark about linux and i386 shows how ignorant you are.

70 Name: Cudder !MhMRSATORI!!L0f5nl0+ : 2008-05-20 01:09 ID:Heaven

I included the file which defined intmax_t, I could've easily typedef'd it with the largest integer type the compiler supported (long long in this case). I didn't include the math lib because I'm only compiling, not linking.

Your remark about "Your remark about linux and i386 shows how ignorant you are" shows how ignorant you are.

>I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones.
>for 386(486) AT clones
>386
>...
>It is NOT portable (uses 386 task switching etc)

fold coming in next post

71 Name: #!/usr/bin/anonymous : 2008-05-20 01:31 ID:Heaven

/* @fold.c */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>

/* TODO: possible memory limit on huge lines and -s? */

extern char *optarg;
extern int optind,optopt;

int col=0;

char *linebuf;
char *lsp;
char *remain_ptr;
int linebuf_size;
int linebuf_used;
int remain_cnt;

int (*foldgetc)(FILE *)=fgetc;

int fold_get(FILE *f) {
if(remain_cnt) {
remain_cnt--;
return *(remain_ptr++);
} else
return fgetc(f);
}

int main(int argc, char **argv) {
int width = 80, bflag=0, sflag=0, retval=0;
int i;
FILE *f;

while((i=getopt(argc,argv,"bsw:"))!=-1) {
switch(i) {
case 'b':
bflag=1;
break;
case 's':
sflag=1;
foldgetc=fold_get;
break;
case 'w':
if((width=atoi(optarg))<1) {
fprintf(stderr,"%s: invalid width %d\n",argv[0],width);
return 1;
}
break;
case '?':
fprintf(stderr,"%s: invalid option %c\n",argv[0],optopt);
return 1;
}
}
if(argc==optind) {
f=stdin;
i=argc;
goto fold_stdin;
} else
i=optind;
while(i<argc) { /* loop for each file */
int c;
if(!(f=fopen(argv[i++],"rb"))) {
fprintf(stderr,"%s: error opening %s: %s\n",argv[0],argv[i-1],strerror(errno));
retval|=1;
continue;
}
fold_stdin:
if(sflag && !linebuf) {
if(!(linebuf=malloc(80))) {
fprintf(stderr,"%s: cannot allocate line buffer\n",argv[0]);
return 1;
} else
linebuf_size=80;
}
while((c=foldgetc(f))!=EOF) { /* folding loop */
if(c=='\n') {
if(sflag && linebuf && linebuf_used) {
fwrite(linebuf,1,linebuf_used,stdout);
linebuf_used=0;
lsp=0;
}
putchar('\n');
col=0;
continue;
}
if(!bflag) {
switch(c) {
case '\t':
col=(col/8+1)*8;
break;
case '\b':
col=col?col-1:0;
break;
case '\r':
col=0;
break;
default:
col++;
}
} else
col++;
if(col>width) {
col=1;
if(sflag && linebuf) { /* release stored line */
fwrite(linebuf,1,lsp?(lsp-linebuf+1):linebuf_used,stdout);
remain_ptr=lsp?lsp+1:0;
remain_cnt=lsp?linebuf_used-(lsp-linebuf+1):0;
lsp=0;
linebuf_used=0;
ungetc(c,f);
putchar('\n');
col=0;
continue;
}
putchar('\n');
}
if(sflag) {
if(linebuf_used>=linebuf_size) {
char *new_linebuf;
if(!(new_linebuf=realloc(linebuf,2*linebuf_size))) {
fprintf(stderr,"%s: not enough memory to process %s\n",argv[0],argv[i-1])
retval=1;
goto outer_continue;
}
linebuf=new_linebuf;
linebuf_size*=2;
}
linebuf[linebuf_used++]=c;
if(c==' ')
lsp=linebuf+linebuf_used-1;
} else
putchar(c);
}
outer_continue:
if(ferror(f)) {
fprintf(stderr,"%s: error reading %s: %s\n",argv[0],argv[i-1],strerror(errno));
retval=1;
}
if(sflag) {
if(linebuf_used)
retval|=fwrite(linebuf,1,linebuf_used,stdout);
linebuf_used=0;
lsp=0;
}
if(f!=stdin)
retval|=fclose(f);
}
if(linebuf)
free(linebuf);
return retval;
}

72 Name: #!/usr/bin/anonymous : 2008-05-20 07:10 ID:Heaven

> do you have such a system where it won't work?

yes. i compile everything with -pedantic -Wall -W -Werror, and optionally std=c99. if it doesn't compile with those, it's broken.

73 Name: #!/usr/bin/anonymous : 2008-05-20 07:52 ID:Heaven

>>70
chgrp.c, chown.c, md5sum.c, mkdir.c, rmdir.c, and sha1sum.c don't compile because of syntax errors. mkfifo.c assumes mode_t is signed, which it isn't on my system. tty.c contains a syntax error but gcc compiles it anyway.

xxxxxx@olorin$ wget -U Mozilla -nd -m -np -E -R html http://rechan.eu.org/misc/anoncoreutils/ >& /dev/null
xxxxxx@olorin$ ls < ~/ac >
ABOUT.HTM chown.c mkdir.c rmdir.c.0 true.c
CODEGUIDELINES chroot.c mkfifo.c robots.txt tty.c
LIST echo.c mkfifo.c.0 sha1sum.c uname.c
NAMING echo.c.0 nice.c sleep.c unlink.c
arch.c false.c nohup.c sync.c whoami.c
basename.c head.c paste.c tee.c yes.c
cat.c link.c pwd.c tee.c.0
chgrp.c md5sum.c rmdir.c touch.c
xxxxxx@olorin$ mkdir bin < ~/ac >
xxxxxx@olorin$ for source in *.c < ~/ac >
for> do
for> gcc -Os -s -pipe -ansi -pedantic $source -o bin/`echo $source|sed s/\.c$//`
for> done
chgrp.c:15: error: syntax error before "do_chgrp"
chown.c:18: error: syntax error before "do_chown"
md5sum.c:2: warning: ISO C90 does not support `long long'
md5sum.c:110: error: syntax error before '/' token
mkdir.c:31: error: syntax error before "int"
mkdir.c: In function `main':
mkdir.c:62: warning: comparison is always false due to limited range of data type
mkfifo.c: In function `main':
mkfifo.c:39: warning: comparison is always false due to limited range of data type
pwd.c:6:2: warning: no newline at end of file
rmdir.c:6: error: syntax error before "void"
rmdir.c:15: error: syntax error before "int"
sha1sum.c:2: warning: ISO C90 does not support `long long'
sha1sum.c:65: error: syntax error before '/' token
sync.c: In function `main':
sync.c:2: warning: return type of 'main' is not `int'
touch.c: In function `main':
touch.c:108: warning: initializer element is not computable at load time
touch.c:108: warning: initializer element is not computable at load time
touch.c:121:2: warning: no newline at end of file
tty.c: In function `main':
tty.c:8: warning: ISO C forbids omitting the middle term of a ?: expression
whoami.c: In function `main':
whoami.c:5: warning: return type of 'main' is not `int'

74 Name: Cudder !MhMRSATORI!!L0f5nl0+ : 2008-05-20 09:11 ID:Heaven

>>73
We are aware of that, and these errors will be fixed in the June update:

  • chown:15 and chgrp:15 had "it" instead of "it"
  • md5sum and sha1sum had C++ comments
  • no idea what was wrong with mkdir, but the updated version compiles fine.
  • same with mkfifo
  • rmdir had inline

75 Name: #!/usr/bin/anonymous : 2008-05-20 09:12 ID:Heaven

>>74
err... "int" instead of "it"

76 Name: #!/usr/bin/anonymous : 2008-05-20 10:21 ID:Heaven

I included the file which defined intmax_t, I could've easily typedef'd it with the largest integer type the compiler supported (long long in this case). I didn't include the math lib because I'm only compiling, not linking.

long long is also C99. So you can't do that. You fail once more.

77 Name: #!/usr/bin/anonymous : 2008-05-20 10:22 ID:Heaven

You fucking faggots, no matter how many times it is explained to you that your codes are broken...

78 Name: #!/usr/bin/anonymous : 2008-05-20 11:36 ID:Heaven

>>40

> I believe in ``trust the programmer'', i.e. I know what I'm doing, and if I make a mistake I'm smart enough to figure out what it is; IMHO relying on warnings just offloads too much thought to the (dumb) machine

>>74

> no idea what was wrong with mkdir, but the updated version compiles fine.

79 Name: #!/usr/bin/anonymous : 2008-05-20 11:52 ID:Heaven

>>78
Those are two different people, and I'm guessing neither of them wrote mkdir.

I don't see anything wrong with the fold though.

80 Name: HAHAHaruhi!6mHaRuhies : 2008-05-20 12:09 ID:Heaven

>>76
long long is also gcc, IBMcc, HP's cc, and several others. They put it in c99 because of this existing practice.

As an aside, we're thinking of adding a "long long long" to AnonCC which, if the machine supports it, will be at least 128 bits. (Yes, we're making plans for beyond Anoncoreutils already, sinec development is pretty quick right now.)

81 Name: #!/usr/bin/anonymous : 2008-05-20 12:24 ID:Heaven

>>79
it demonstrates that "trusting the programmer" is stupid, not everyone knows what they're doing, and if someone makes a mistake other people aren't smart enough to figure out what it is

anyway i'm looking forward to the june update so i can compile it on my OLPC and see how much shit breaks

maybe i'll dig my mac quadra with A/UX out of the garage too

82 Name: Cudder !MhMRSATORI!!L0f5nl0+ : 2008-05-20 13:25 ID:Heaven

>>81
Someone else fixed mkdir, not me (nor do I know who did). Whoever did didn't log the change, and I don't feel like bringing up the diff.

>and if someone makes a mistake other people aren't smart enough to figure out what it is

mkdir.c works now, so someone was smart enough to find the bug. I don't care who did it, the important thing was it got fixed.

Are you the guy who posted a pic of /g/ on an OLPC on /g/?

83 Name: #!/usr/bin/anonymous : 2008-05-20 15:12 ID:Heaven

>>74
mkdir had inline too.

mkfifo assumes mode_t is signed.
dectooct returns -1 if you give it a number that has the digits 8 or 9 in it. you store the int result of dectooct in the mode_t variable mode and then check to see if it's equal to -1 to determine whether the mode supplied by the user is valid:

if(mode == -1) {
fprintf(stderr, "%s: invalid mode\n", argv[0]);
return 1;
}

mode cannot ever be -1 if mode_t is unsigned (which it is on my system), so it continues on and tries to set the mode to 0177777.

also, mkfifo really needs to be indented.

84 Name: #!/usr/bin/anonymous : 2008-05-20 18:16 ID:Heaven

>>80

As an aside, we're thinking of adding a "long long long" to AnonCC which, if the machine supports it, will be at least 128 bits.

You show your ignorance once more. At this point I think you're just a troll and you're not serious.
First of all, there is nothing that says long long can't be 128 bits. Secondly, the hardware doesn't have to support qwords to have your type being 128 bits. You clearly know shit about anything, regarding anything.
Your whole dectoot function is broken, and its call with atoi() is also broken and shows how little you know about security.
Use this:
unsigned int foo;
if(sscanf(optarg, "%o", &foo) != 1) { /* error */ }

You silly faggots, another bug found in your code. I find these bugs just by looking at the code, without even loading it at my damn editor. You stupid faggots, you damn imbeciles.
No matter how many times I'll point out your errors you'll still persist that you somehow have a "project" with correct code and whatnot. I really hate you faggot.

85 Name: #!/usr/bin/anonymous : 2008-05-20 18:17 ID:Heaven

>>84
dang, not qword. It doesn't have to support 128bit types.

86 Name: #!/usr/bin/anonymous : 2008-05-20 18:17 ID:Heaven

>>85
I mean units. dammit.

87 Name: HAHAHaruhi!6mHaRuhies : 2008-05-20 23:22 ID:Heaven

>First of all, there is nothing that says long long can't be 128 bits

You missed the part about "at least". Also

long >= 32 bits
long long >= 64 bits
long long long >= 128 bits (the next logical step?)

I know the hardware doesn't have to support 128-bit types for it to be in the language, but this is more of an extension than anything else. AnonCC plans are very vague right now, we might not even add triple-long if it serves no useful purpose.

>>83,84
Yeah, the whole dectooct() is retarded and we're going to rewrite it. It doesn't even support the POSIX symbolic modes (+w, -r, g=o, etc.) Your hate only makes us more determined to fix it.

88 Name: #!/usr/bin/anonymous : 2008-05-21 05:13 ID:Heaven

> long long long >= 128 bits (the next logical step?)

Just a suggestion... If you have 128-bit integers at all, call them int128_t and uint128_t (and intleast128_t, uintleast128_t, intfast128_t, uintfast128_t, intmax_t, and uintmax_t).
If you want to also have a 128-bit long long long that's fine, but if you don't have the standard names it's fucking useless.
Also, if you're planning on writing a new C compiler that doesn't support C99, don't bother.

89 Name: #!/usr/bin/anonymous : 2008-05-21 08:26 ID:Heaven

>>88
typedef long long long int int128_t
typedef unsigned long long long int uint128_t

etc.

90 Name: #!/usr/bin/anonymous : 2008-05-21 09:03 ID:Heaven

>>89
int128_t must be exactly 128 bits, and a two's complement integer.
long long long if existant is not required to be that.
What HAHAFAGGOT doesn't understand is that ISO C permits 'long long' to be 128 bits. or long to be 256 bits. long long long would be a useless addition.
You know what your problems are?
That a), I could write all the code you've written so far in less than a day, and b) that I reported a bug to you, I showed you how to fix it and you still haven't fixed it, which means that you can't or that you are bored. Clearly your "project" will fail. It's good for trolling but nothing more.

91 Name: Cudder !MhMRSATORI!!L0f5nl0+ : 2008-05-21 11:19 ID:Heaven

>>90
if we add 3-long, we decide how long it's going to be and 128 seems like a good length. yes long long could be 128 on a wider machine but then 3-long will be even bigger still, like 256. and if long is 256, we'll make long long 512 and long long long 1024. but this is purely theoretical, no ordinary machines we know of are this wide and certainly none of us own one.

i have no idea how much she wrote, but she spends more time discussing the project with us than writing code. she also has IRL to contend with, like the rest of us. a/x is just a side project, not full-time work.

what bug are you talking about? if you're complaning about the versions on REchan right now not having been fixed, shut the fuck up and learn to read because i explained like three fucking times already ***THE UPDATES WILL BE RELEASED IN JUNE***

and the more you say a/x is going to fail, the more incentive you give us to work harder on it.

92 Name: #!/usr/bin/anonymous : 2008-05-21 12:13 ID:Heaven


if we add 3-long, we decide how long it's going to be and 128 seems like a good length. yes long long could be 128 on a wider machine but then 3-long will be even bigger still, like 256. and if long is 256, we'll make long long 512 and long long long 1024. but this is purely theoretical, no ordinary machines we know of are this wide and certainly none of us own one.

Then shall we add a long long long long too? It will be long before hardware will support more than 5-6 integer units, and it may not ever be necessary. So long long long is not useful, nor is long long long long, etc. Damn you and your fucking logic. This clearly needs to be in software level, and there are already very good libraries out there (psst, the best is from gnu) for bignum arithmetic.

what bug are you talking about?

All the bugs I pointed out that you alone would never find.


shut the fuck up and learn to read because i explained like three fucking times already ***THE UPDATES WILL BE RELEASED IN JUNE***

Funny, as I said before it would take me less than a day to "update" (ie completely rewrite) all the code you've already written. By the way, I do not have sufficient knowledge nor will to code a whole operating system, linker, compiler, etc etc, which you supposedly want to code. If it takes you so much to update code which normally would take 1 day for any normal programmer, really, what the fuck are you doing?

and the more you say a/x is going to fail, the more incentive you give us to work harder on it.

No matter how much you are going to work on it, it will fail. Be cause you are retarded, you have a woman in your team which is beyond retardism, I mean, how much gayer can you be. You lack the knowledge, and the brain power. It is not a matter of "trying".

P.S. total absolute failures. you and your banal ideas, curse you all. Gedanken tomfools.

93 Name: !w4lolitaKs : 2008-05-21 13:45 ID:Heaven

Thanks for the input, but you missed this:

>but this is purely theoretical

We're considering a triple long, not desperately thinking of adding one. Enough talk about longs, it's getting rather long.

>Funny, as I said before it would take me less than a day to "update" (ie completely rewrite) all the code you've already written.

And I wrote an ANSI C compiler in ANSI C when I was 12. PROVE IT! Besides, we have other things to do than work on a/x 24/7.

> If it takes you so much to update code which normally would take 1 day for any normal programmer

And again you fail at reading comprehension. We have our own private-but-open (read the posts again, you might just figure out how to access it) repository and FTP server. The code there is the most recent and all the bugs are fixed there. BUT WE ARE NOT UPLOADING IT TO RECHAN UNTIL JUNE.

>Be cause you are retarded, you have a woman in your team which is beyond retardism

lol, resorting to misogyny now?

94 Name: #!/usr/bin/anonymous : 2008-05-21 15:06 ID:Heaven

So now the public basically isn't allowed to contribute. Or, we can throw random code snippets into the void, but only the double secret ninja hackers in your uncharted island repository can have any clue what's actually happening.

And there's so much progress among them that all the code we can see is irrelevant.

95 Name: #!/usr/bin/anonymous : 2008-05-21 19:52 ID:Heaven

>>93
Look fucktard, resorting to misogynism (not misogyny, learn English) fuck yes. I hate women, because they are retarded, stupid, retarded and not suited for programming. Just what the fuck do you think OS developing is? Your damn playground? You can't develop for shit if you don't know your shit, shithead.
And I wrote an ANSI C compiler in ANSI C when I was 12. PROVE IT! Besides, we have other things to do than work on a/x 24/7.

I have already proven it by showing you all these bugs you have. I'm not just posting here, I post at /prog/ as well. I have showed you bugs there too. Basically you can't write a code that doesn't have bugs. And that's because you are shit programmers. Maybe good trolls, but shit programmers.
The fact that you consider a triple long shows how stupidfucktarded you are. Just don't consider it. It's a stupid idea.
And anyway, how the fuck do you want me to prove it? Write all the code for you, post it here so you can steal it? Fuck you, faggots. Your desperation shows with such posts.
I HATE YOU. SAGEEEEEEEEEEEEEEEEEEEEEE

96 Name: #!/usr/bin/anonymous : 2008-05-22 03:14 ID:Heaven

This thread sucks. Please stop posting here.

97 Name: #!/usr/bin/anonymous : 2008-05-22 04:22 ID:Heaven

Wow, a project destined for failure before it was even thought of. Enjoy wasting your time, faggots.

98 Name: #!/usr/bin/anonymous : 2008-05-22 06:10 ID:Heaven

http://rechan.eu.org/s/ is broken.
you can't even write a simple php script and you're writing an operating system?

99 Name: Cudder !2TZtn9Z7zI!!L0f5nl0+ : 2008-05-22 10:16 ID:Heaven

>>98
Didn't notice that. There's nothing wrong with r4:

>[Thu May 22 05:05:40 2008] [error] [client x.x.x.x] PHP Warning: file_put_contents(index.htm) [function.file-put-contents]: failed to open stream: Permission denied in /chroot/home/rechaneu/rechan.eu.org/html/s/r4.php on line 285, referer: http://rechan.eu.org/s/

Stop jumping to conclusions. It was working before we moved hosts. And now it's been fixed.

100 Name: #!/usr/bin/anonymous : 2008-05-22 10:56 ID:Heaven

>>99
Everything you've ever coded is bad and you should feel bad.

101 Name: #!/usr/bin/anonymous : 2008-05-22 12:03 ID:Heaven

>>99
No it wasn't, the whole site was broken before you moved.
http://wakaba.c3.cx/soc/kareha.pl/1108009355/n180-

102 Name: #!/usr/bin/anonymous : 2008-05-23 13:01 ID:apPW4NZm

Hmm... I was looking through the BSD source tree and wondering why BSD doesn't have their own compiler? They seem to use gcc too.

103 Name: #!/usr/bin/anonymous : 2008-05-23 14:24 ID:Heaven

>>102
Apparently 4.4BSD, the final release of the original which the current distributions of BSD are descended from, switched from a truly ancient compiler (1970s vintage) called "pcc" to gcc. I'm not certain why; pcc might have been AT&T owned at the time, or just suffering from neglect.

A maintainer appeared last year and started working on pcc again, and there's talk that the more ideological BSDs (i.e. not FreeBSD) might switch back to using it.

104 Post deleted.

105 Name: #!/usr/bin/anonymous : 2008-06-01 04:03 ID:apPW4NZm

106 Name: #!/usr/bin/anonymous : 2008-06-01 06:52 ID:Heaven

107 Name: #!/usr/bin/anonymous : 2008-06-01 09:57 ID:o77g6cSx

>>102,105
i lol'd at !6mHaRuhies, !MhMRSATORI!!L0f5nl0+ and above having the same ID

108 Name: HAHAHaruhi!6mHaRuhies : 2008-06-01 19:59 ID:Heaven

>>107
We're posting through the local repo server. It's so you can identify what posts are from the Anonix core group (which manages file releases among other things) to prevent someone else from faking a release filled with GNU copypasta.

109 Name: #!/usr/bin/anonymous : 2008-06-02 05:23 ID:Heaven

>>108
What, being a tripfag isn't adequate proof of your identity?

Also, you should mention somewhere your shit isn't BSD 4.3 compatible and requiring _XOPEN_SOURCE=600 or similar to compile without spewing undefined identifiers, at least on my system.

Also, ISO C90 still doesn't support 'long long'.

110 Name: #!/usr/bin/anonymous : 2008-06-02 07:19 ID:Heaven

>>109
a/c isn't Windows compatible either now is it?

Try compiling on a fully POSIX compliant system.

Compile the few progs that use 'long long' in C99 mode if you must.

111 Name: 109 : 2008-06-02 12:36 ID:Heaven

> Try compiling on a fully POSIX compliant system.

I'm running Ubuntu on an OLPC. Care to suggest what I can install on an OLPC that's fully POSIX compliant, since that apparently isn't?

112 Name: HAHAHaruhi!6mHaRuhies : 2008-06-03 01:40 ID:Heaven

>>111
MINIX ought to work, but I'm using LFS with the include files edited to naturally define the POSIX stuff (instead of having it locked inside #ifdef's).

(Not too familiar with OLPC, but I think it's a standard PC architecture which should be fine.)

113 Name: #!/usr/bin/anonymous : 2008-06-09 03:04 ID:o77g6cSx

rechan is down halp

114 Name: #!/usr/bin/anonymous : 2008-06-10 09:01 ID:apPW4NZm

>>113
works now, probably just server maintenence

115 Name: HAHAHaruhi!6mHaRuhies : 2008-06-18 04:47 ID:apPW4NZm

116 Name: #!/usr/bin/anonymous : 2008-07-21 08:00 ID:ypIp/jYN

int haxanus (void) {
printf("file not found, DESU\n");
exit(EXIT_FAILURE);
}

117 Name: #!/usr/bin/anonymous : 2008-07-22 03:26 ID:rYmf8Fff

>>116
That is distasteful.

118 Name: #!/usr/bin/anonymous : 2008-08-07 20:25 ID:rtuaM8jN

Eliminating the bloat that GNU utilities have? Command line programs?

You people are tripping.

119 Name: #!/usr/bin/anonymous : 2009-03-20 19:52 ID:ueqlybyn

lol permasaged

120 Name: #!/usr/bin/anonymous : 2009-10-29 17:47 ID:L5K0Hweo

RAGE FAGGOTS, RAGE!

Also, Boxxy.

Also THE GAME!

121 Name: #!/usr/bin/anonymous : 2009-11-22 11:08 ID:PSB0el/0

HAX MY ANUS!

122 Name: #!/usr/bin/anonymous : 2010-02-26 10:48 ID:GoK6iFkf

     | \
     |Д`)   No one is here.
     |⊂     I can dance now !
     |

     ♪  ☆
   ♪   / \    RANTA TAN
      ヽ(´Д`;)ノ   RANTA TAN
         (  へ)    RANTA RANTA
          く       TAN

   ♪    ☆
     ♪ / \   RANTA RANTA
      ヽ(;´Д`)ノ  RANTA TAN
         (へ  )    RANTA TANTA
             >    TAN

123 Name: #!/usr/bin/anonymous : 2010-10-27 08:42 ID:GoK6iFkf

>122

i see you, but that doesn't count in a permasaged thread anyway

124 Post deleted.

125 Post deleted.

126 Name: Anonymous Techie : 2024-02-25 10:55 ID:VOxLRspi

posting in a legendary kusosure

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: