LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   [squeeze]Found error in standard header?! (bits/errno.h) (https://www.linuxquestions.org/questions/debian-26/%5Bsqueeze%5Dfound-error-in-standard-header-bits-errno-h-4175430862/)

Weapon S 10-06-2012 12:11 PM

[squeeze]Found error in standard header?! (bits/errno.h)
 
While building Allegro 4.4, it complained about a superfluous #endif on line 49 of a system header. What a cryptic error! Internet had no answer. Me delves into all the source and cmake scripts of the library. No progress.
Me resumes staring at alleged point of error.

/usr/include/bits/errno.h (start@20)
Code:

#ifdef _ERRNO_H

# undef EDOM
# undef EILSEQ
# undef ERANGE
# include <linux/errno.h>

/* Linux has no ENOTSUP error code.  */
# define ENOTSUP EOPNOTSUPP

/* Older Linux versions also had no ECANCELED error code.  */
# ifndef ECANCELED
#  define ECANCELED        125
# endif

/* Support for error codes [Some binary representations of those codes]
#  define EOWNERDEAD                130
#  define ENOTRECOVERABLE        131
# endif

# ifndef __ASSEMBLER__
/* Function to get address of global `errno' variable.  */
extern int *__errno_location (void) __THROW __attribute__ ((__const__));

#  if !defined _LIBC || defined _LIBC_REENTRANT
/* When using threads, errno is a per-thread value.  */
#  define errno (*__errno_location ())
#  endif
# endif /* !__ASSEMBLER__ */
#endif /* _ERRNO_H */

Except for binary representations, this is exactly what was there. There really was a superfluous #endif on line 38!

Remove binary code, add comment ending, remove #endif. IT WORKED @~~~~0

I can only imagine that this is a deprecated header, or this weird beginning of /usr/include/errorno.h (which is includer of other header) does some voodoo: (the comment shouldn't matter, should it?)
Code:

#ifndef        __need_Emath
# define _ERRNO_H        1
# include <features.h>
#endif

__BEGIN_DECLS

/* Get the error number constants from the system-specific file.
  This file will test __need_Emath and _ERRNO_H.  */
#include <bits/errno.h>
#undef        __need_Emath

#ifdef        _ERRNO_H

If someone can confirm that this header is deprecated, I'd appreciate it. Something needs fixing.

knudfl 10-07-2012 04:59 AM

? A buggy version of allegro-4.4 ?

cd allgro-4.4.2/ && mkdir build && cd build/ && cmake ../ && make
http://garr.dl.sourceforge.net/proje...o-4.4.2.tar.gz

I got no errors on any OS, including Debian Squeeze 32bits and 64bits.


The headers /usr/include/bits/errno.h, /usr/include/linux/errno.h
are provided by package 'libc6-dev'.

.

Weapon S 10-07-2012 07:38 AM

Thanks for trying that. Would you indulge me and have a look at your /usr/include/bits/errno.h, specifically around line 38? I have heard of another user on Ubuntu having the same problem as I did.
I don't know how high the chances are there actually is a mirror that provides faulty files. (But then again the number of files stored over the years is very big.)
-----
GAH. How stupid of me! "Binary codes"? Corrupted file is more like it.

Weapon S 10-12-2012 11:33 AM

Nailed it
 
It was memory corruption leading to disk errors. Very small chance such files are distributed defective.


All times are GMT -5. The time now is 02:12 PM.