Few suggestions

nsf no.smile.face at gmail.com
Thu Jun 19 00:39:24 CEST 2008

On Wed, 18 Jun 2008 01:55:40 +0200
Marc Lehmann <schmorp at schmorp.de> wrote:

> patches welcome.

Well, I have already sent a patch to mailing list. I hope you didn't
miss it. I just want to make sure you got is, so here is the link:

> you didn't just change your code to just ugly code, you took (potentially)
> *working* code and *broke* it, invoking undefined behaviour.

As long as my code is giving me *exactly* the same behaviour as macros
code, my code isn't broken.

[nsf @ src]$ diff -Naur v1 v2
diff -Naur v1/bmpanel.o v2/bmpanel.o
--- v1/bmpanel.o	2008-06-18 14:56:29.000000000 -0700
+++ v2/bmpanel.o	2008-06-18 14:56:51.000000000 -0700
@@ -2827,14 +2827,14 @@
 	je	.L328
 	movl	%esi, -44(%ebp)
+	leal	-68(%ebp), %eax
 	movl	$0, -60(%ebp)
 	movl	$0, -64(%ebp)
 	movl	$0, -68(%ebp)
 	movl	$xconnection_cb, -52(%ebp)
 	movl	$129, -40(%ebp)
-	leal	-68(%ebp), %eax
-	movl	%ebx, (%esp)
 	movl	%eax, 4(%esp)
+	movl	%ebx, (%esp)
 	call	ev_io_start
 	leal	-104(%ebp), %eax
 	movl	$0, -96(%ebp)

Asm diff listing shows only minor changes in commands ordering,
behaviour is the same.

It is possible that on some configurations on some stupid compilers my
code is broken, but my software isn't portable. It is linux/gcc/x86

> That's a blatant lie :) They are _broken_ without them. Get a
> (necessarilys, as average books don't cover this) good book about C and
> learn about aliasing rules.

Btw, timer-related variants actually purely identical in asm.

Anyway, I don't want to argue with you. It's your right to think your
way. If it isn't possible for you to make changes, I'll leave hacks in
my code or eventually I will change the library.

Thank you for your reply.

More information about the libev mailing list