[DGD] Bugz

Blain blain20 at gmail.com
Wed Apr 24 16:12:01 CEST 2013


Small one this time (not an emergency) ;)


Assume INHERITABLE_SUBDIR is undefined due to failing to include <config.h>

#include <kernel/user.h>

Test 1:
void start(object LIB_USER new_user)

Test 2:
  print(LIB_USER);

Error 1:
[Compile] /sys/lib/user/api/io[18]: syntax error

Error 2:
[Compile] /sys/lib/user/api/io[20]: undeclared variable INHERITABLE_SUBDIR


Error 1 isn't very helpful, to say the least.  I stumbled upon error 2
while working with Shentino to figure out what the syntax error was exactly.


After fixing that, I get a second problem that is a bit more important.  I
can't set an object to this type-forced object.  I can work around it by
checking inheritance outside of the funcspec, though.

Test 1:
#include <config.h>
#include <kernel/user.h>

private object user;

void start(object LIB_USER new_user)
  if(user && new_user != user)     (<< line 22)

Error 1:
[Compile] /sys/lib/user/api/io[22]: incompatible types for equality
(object, object)

I don't recall seeing if there was a way to make my global variable 'user'
a LIB_USER, so I'm not sure what to do here other than remove LIB_USER from
the funcspec and do a <- check instead.  I'll do the latter for now.

Thanks ;)

--Blain



More information about the DGD mailing list