Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 69926 - Infinite recursion in <ptlib.h>
Infinite recursion in <ptlib.h>
Product: Red Hat Raw Hide
Classification: Retired
Component: pwlib (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Alexander Larsson
Depends On:
Blocks: 67218
  Show dependency treegraph
Reported: 2002-07-26 10:45 EDT by Alec Voropay
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-08-01 08:35:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alec Voropay 2002-07-26 10:45:56 EDT
Description of Problem:
It is impossible to compile any "pwlib" app.
#include <ptlib.h>
produces infinite loop

Version-Release number of selected component (if applicable):

How Reproducible:
Try to compile any "pwlib" app

Steps to Reproduce:
1. Install

2. Tiny "pwlib" app:  "a.cxx"
#include <ptlib.h>
main (){};

3. "pwlib-style" Makefile
PROG    = a
SOURCES = a.cxx
include $(PWLIBDIR)/make/ptlib.mak

$ export PWLIBDIR=/usr/share/pwlib

$ make opt

Actual Results:

It goes into infinite include loop:

[root@monitor a]# make opt
I/usr/include/include -I/usr/include/crypto -DP_EXPAT -DP_PTHREADS -
I/usr/share/pwlib/include/ptlib/unix -I/usr/share/pwlib/include -O3 -DNDEBUG  -
c a.cxx -o obj_linux_x86_r/a.o
In file included from /usr/include/ptlib/ptime.h:634,
                 from /usr/include/ptlib/ptime.h:634,
                 from /usr/include/ptlib/ptime.h:634,
                 from /usr/include/ptlib/ptime.h:634,
                 from /usr/include/ptlib/ptime.h:634,
                 from /usr/include/ptlib/ptime.h:634,
                 from /usr/include/ptlib.h:142,
                 from a.cxx:1:
/usr/include/ptlib/ptime.h:126:18: #include nested too deeply
/usr/include/ptlib/ptime.h:634:25: #include nested too deeply
In file included from /usr/include/ptlib/timeint.h:455,
                 from /usr/include/ptlib/timeint.h:455,
                 from /usr/include/ptlib/timeint.h:455,
                 from /usr/include/ptlib/timeint.h:455,

Expected Results:
Should compile

Additional Information:

See next post
Comment 1 Alec Voropay 2002-07-26 10:56:42 EDT
Pay attention to files included in "/usr/include/ptlib.h"
For example line 142:
#include <ptlib/ptime.h>

 This file ""/usr/include/ptlib/ptime.h" RECURSIVELY calls
himself. Look at the end :

// Include platform dependent part of class
#include <ptlib/ptime.h>

 This line should call PLATFORM DEPENDENT .h  !!!

#include <ptlib/unix/ptlib/ptime.h>

Comment 2 Alec Voropay 2002-08-01 04:08:30 EDT
There is another way : to do full set of symlinks in PWLIBDIR directory.

Changed pwlib.spec  (I've added -m644 permission for include/*.h)


mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/lib
mkdir -p $RPM_BUILD_ROOT/usr/include/ptclib
mkdir -p $RPM_BUILD_ROOT/usr/include/ptlib/unix/ptlib
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}/make
cp -d lib/*so* $RPM_BUILD_ROOT/usr/lib
install -m 644 include/ptlib.h $RPM_BUILD_ROOT/usr/include
install -m 644 include/ptlib/*.h $RPM_BUILD_ROOT/usr/include/ptlib/
install -m 644 include/ptlib/*.inl $RPM_BUILD_ROOT/usr/include/ptlib/
install -m 644 include/ptlib/unix/ptlib/*.h 
install -m 644 include/ptlib/unix/ptlib/*.inl 
install -m 644 include/ptclib/*.h $RPM_BUILD_ROOT/usr/include/ptclib/
install tools/asnparser/obj_linux_*/asnparser $RPM_BUILD_ROOT/usr/bin

ln -s $RPM_BUILD_ROOT/%{_datadir}/%{name}/include  /usr/include
ln -s $RPM_BUILD_ROOT/%{_datadir}/%{name}/lib  /usr/lib
ln -s $RPM_BUILD_ROOT/%{_datadir}/%{name}/bin  /usr/bin
mkdir $RPM_BUILD_ROOT/%{_datadir}/%{name}/tools
ln -s $RPM_BUILD_ROOT/%{_datadir}/%{name}/tools/asnparser  /usr/bin

Comment 3 Alec Voropay 2002-08-01 08:35:35 EDT
Sorry,  ln -s  src  dst  .....

ln -s /usr/include $RPM_BUILD_ROOT/%{_datadir}/%{name}/include
ln -s /usr/lib     $RPM_BUILD_ROOT/%{_datadir}/%{name}/lib
ln -s /usr/bin     $RPM_BUILD_ROOT/%{_datadir}/%{name}/bin  
mkdir $RPM_BUILD_ROOT/%{_datadir}/%{name}/tools
ln -s /usr/bin     $RPM_BUILD_ROOT/%{_datadir}/%{name}/tools/asnparser  
Comment 4 Alexander Larsson 2002-08-07 05:37:46 EDT
Due to stupid naming on the part of the pwlib team you need to list
-I/usr/include/ptlib/unix/ before /usr/include (which is last by default).

"g++ -I/usr/include/ptlib/unix/ a.cxx" works for me.

Note You need to log in before you can comment on or make changes to this bug.