Menu

#1 Type error in execi()

closed-fixed
None
5
2004-01-25
2002-09-20
Anonymous
No

Since the declaration of the system call execi() is
in unistd.h as:

extern pid_t execi(int (*code_start) (int, char **), int
argc, char **argv, priority_t priority, size_t stack_size);

and the definition of the type pid_t is in tm.h as:

typedef size_t pid_t;

and taking into account that the definition of size_t is in
mem.h as:

typedef unsigned size_t;

I guess there is an incompatibility of types since execi()
returns a -1 (signed) if there is a fail.

This can be avoid with a C compilation but not with C++.
So, trying to handle the fail code (-1) from the system
call execi() the C++ compiler shows a warning in the
comparison between signed and unsigned.

Discussion

  • Stephen M. Moraco

    • assigned_to: nobody --> stephmo
     
  • Stephen M. Moraco

    • status: open --> closed-fixed
     

Log in to post a comment.