Bug 154988

Summary: bad preprocessor directives in /usr/inclide/asm/pci-direct.h and others
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Peter Breitenlohner <peb>
Component: BasesystemAssignee: Andreas Jaeger <aj>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: aj
Version: unspecified   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Peter Breitenlohner 2006-03-03 13:48:21 UTC
Some of the glibc bi-arch asm headers have invalid syntax, due to a bug in the create_biarch_asm.sh shell script used to create them

The problem is, that a hypen in the header file name is NOT translated into an underscore as it ought to be. In the generated /usr/include/asm/pci-direct.h this results in
  #ifndef __X86_64_ASM_STUB__PCI-DIRECT_H__
  #define __X86_64_ASM_STUB__PCI-DIRECT_H__
instead of
  #ifndef __X86_64_ASM_STUB__PCI_DIRECT_H__
  #define __X86_64_ASM_STUB__PCI_DIRECT_H__

This doesn't matter much because these headers are hardly ever included, but should nevertheless be corrected.
Comment 1 Andreas Jaeger 2006-03-03 16:32:53 UTC
Let's use the following in the script:
        J=`echo $I | tr a-z.- A-Z__`
Comment 2 Andreas Jaeger 2006-03-03 16:37:39 UTC
which results in the desired:

#ifndef __X86_64_ASM_STUB__PCI_DIRECT_H__
#define __X86_64_ASM_STUB__PCI_DIRECT_H__

Comment 3 Peter Breitenlohner 2006-03-03 16:43:46 UTC
(In reply to comment #2)
> which results in the desired:
> 
> #ifndef __X86_64_ASM_STUB__PCI_DIRECT_H__
> #define __X86_64_ASM_STUB__PCI_DIRECT_H__
> 

Exactly what I wanted to trigger.

A related question: Should these header wrappers really be protected from multiple inclusions? Some of the real headers in asm-i386 and asm-x86_64 are not so protected! Is that on purpose or just an oversight?
Comment 4 Andreas Jaeger 2006-03-03 16:48:45 UTC
I guess that's an oversight.

AFAIR these defines are just an optimization, they are not really needed.  If they break anything, we should look at them.