freeradius-server-2.1.10 compiles on HP-UX 11.31 with errors.
Hi all, I compiled and installed freeradius (freeradius-server-2.1.10) on a HPUX 11.31 Itanium V3 system, but I had to make some little code and makefile modifications. I would like to tell you these changes In the file : freeradius-server-2.1.10/src/modules/rlm_eap/rlm_eap.c in the new function static int eap_handler_ptr_cmp, the HP CC compiler gives an error on the returning value type. diff: line 111 < return (a - b); ---
return ((int)a - (int)b);
In the file : freeradius-server-2.1.10/raddb/Makefile the HP ln command, don't understand the command line format. a '.' should be add to the end of command lines diffs: 26c26 < cd sites-enabled && ln -s ../sites-available/default; \ ---
cd sites-enabled && ln -s ../sites-available/default .; \
29c29 < cd sites-enabled && ln -s ../sites-available/inner-tunnel; \ ---
cd sites-enabled && ln -s ../sites-available/inner-tunnel .;
\ 78c78 < ln -s ../sites-available/default; \ ---
ln -s ../sites-available/default .; \
82c82 < ln -s ../sites-available/inner-tunnel; \ ---
ln -s ../sites-available/inner-tunnel .; \
86c86 < ln -s ../sites-available/control-socket; \ ---
ln -s ../sites-available/control-socket .; \
Best regards, GIampiero.
Giampiero Torrielli wrote:
I compiled and installed freeradius (freeradius-server-2.1.10) on a HPUX 11.31 Itanium V3 system, but I had to make some little code and makefile modifications.
I would like to tell you these changes
In the file : freeradius-server-2.1.10/src/modules/rlm_eap/rlm_eap.c in the new function static int eap_handler_ptr_cmp, the HP CC compiler gives an error on the returning value type.
diff:
line 111 < return (a - b); ---
return ((int)a - (int)b);
Ugh. The result of subtracting two pointers is usually a signed integer. If you're pedantic, "ptrdiff_t". The compiler shouldn't require a cast to "int". I'm not opposed to adding it, but it really doesn't do anything for ISO C compatible compilers.
In the file : freeradius-server-2.1.10/raddb/Makefile the HP ln command, don't understand the command line format. a '.' should be add to the end of command lines
While this patch works for you, it will break every single other system. So it can't be added to the distribution. Alan DeKok.
--On Tuesday, November 23, 2010 02:38:07 PM +0100 Alan DeKok <aland@deployingradius.com> wrote:
Giampiero Torrielli wrote:
I compiled and installed freeradius (freeradius-server-2.1.10) on a HPUX 11.31 Itanium V3 system, but I had to make some little code and makefile modifications.
I would like to tell you these changes
In the file : freeradius-server-2.1.10/src/modules/rlm_eap/rlm_eap.c in the new function static int eap_handler_ptr_cmp, the HP CC compiler gives an error on the returning value type.
diff:
line 111 < return (a - b); ---
return ((int)a - (int)b);
Ugh. The result of subtracting two pointers is usually a signed integer. If you're pedantic, "ptrdiff_t". The compiler shouldn't require a cast to "int".
I'm not opposed to adding it, but it really doesn't do anything for ISO C compatible compilers.
You should be -- if the compiler accepts it at all, it changes the semantics. Casting void * to int is not strictly legal and won't work on platforms where void * is larger than int. That said, the existing code is not that great, either -- ptrdiff_t is not guaranteed to fit in an int; in fact, I just found a bug last night in another piece of software caused by ptrdiff_t being long. Of course, the OP hasn't reported what the original error was, so I can't really suggest a better fix, but I'll bet it involves changing the return type of eap_handler_ptr_cmp(). -- Jeff
Jeffrey Hutzelman wrote:
You should be -- if the compiler accepts it at all, it changes the semantics. Casting void * to int is not strictly legal and won't work on platforms where void * is larger than int. That said, the existing code is not that great, either -- ptrdiff_t is not guaranteed to fit in an int; in fact, I just found a bug last night in another piece of software caused by ptrdiff_t being long.
Hmmm... ugh.
Of course, the OP hasn't reported what the original error was, so I can't really suggest a better fix, but I'll bet it involves changing the return type of eap_handler_ptr_cmp().
Or: if (a < b) return -1; if (a > b) return +1; return 0; The values don't matter, only the sign, and the fact that the calculation is transitive across more than 2 pointers. Alan DeKok.
--On Tuesday, November 23, 2010 04:53:38 PM +0100 Alan DeKok <aland@deployingradius.com> wrote:
Jeffrey Hutzelman wrote:
You should be -- if the compiler accepts it at all, it changes the semantics. Casting void * to int is not strictly legal and won't work on platforms where void * is larger than int. That said, the existing code is not that great, either -- ptrdiff_t is not guaranteed to fit in an int; in fact, I just found a bug last night in another piece of software caused by ptrdiff_t being long.
Hmmm... ugh.
My thoughts exactly.
Of course, the OP hasn't reported what the original error was, so I can't really suggest a better fix, but I'll bet it involves changing the return type of eap_handler_ptr_cmp().
Or:
if (a < b) return -1; if (a > b) return +1; return 0;
The values don't matter, only the sign, and the fact that the calculation is transitive across more than 2 pointers.
Oh; this is a comparator for a btree. Yeah, this seems like the sanest thing to do. -- Jeff
participants (3)
-
Alan DeKok -
Giampiero Torrielli -
Jeffrey Hutzelman