NetBSD/alpha build fault

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Guest

NetBSD/alpha build fault

Postby Guest » 25 Sep 2004 20:28

I can't compile VLC on NetBSD/alpha. If you want to have a full build log and all, please contact me at weel at caltech dot edu (I don't read this forum) and I'll try the build again and get you a log file, but basically this is why it doesn't build:

in include/vlc_threads_funcs.h , the assumption is being made repeatedly that you can cast a pointer to a pthread to an int. Pointers to threads are stored in various variables and return values of type int, which just doesn't fly on an alpha, which is a 64 bit processor. On the alpha, int is 32 bits and a pointer is 64 bits. This is why pointers should be stored in variables that have a pointer type. If it is not clear what the pointer type should be, or you don't want to have to export that type definition to lots of other files, you can just use void*, but not int. ANSI C does not prescribe that your way needs to work, and your approach may or may not break on other 64 bit machines (some of them have 64 bit ints by default; on the alpha, long is defined to be 64 bits.)

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 25 Sep 2004 22:44

Yes this is a known problem. This was one of the few points where we were truly lazy in my point of view in the design of the vlc sourcecode and it definetly should be fixed.

I'll add this to the todo list.
Don't use PMs for support questions.

Gibalou
Big Cone-huna
Big Cone-huna
Posts: 608
Joined: 26 Nov 2003 10:59

Postby Gibalou » 25 Sep 2004 22:47

It looks like the only pthread casting done in include/vlc_threads_funcs.h are the pthread_self() ones which are only used to display debug messages. Are these the one creating build problems ? They could easily be solved although I don't really understand why the compiler doesn't abide the explicit cast.

Guest

Even C won't cast to to a type of a different size

Postby Guest » 26 Sep 2004 03:56

Gibalou: well, on alpha, int is 32 bits, and void* is 64. Even though C has a pretty permissive type system, you really can't cast a 64 bit value to a 32 bit one.

Derk-Jan: bedankt! NetBSD/alpha is misschien niet zo'n gebruikelijk platform, maar juist daarom is het altijd een goede testbench voor dit soort stomme pointerfoutjes die op een x86 "toevallig" goed gaan.

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 26 Sep 2004 10:04

You can easily cast a 64 bit integer to a 32 or even a 8 bit integer in C. I don't see way the same shouldn't be true for a pointer.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 17 guests