OgreKit

View: New views
7 Messages — Rating Filter:   Alert me  

OgreKit

by Donatas Petrauskas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I had a problem compiling OgreKit in Étoilé trunk revision 4439.

Some information about my system:

dop % onig-config --version
5.9.1

dop % gcc -v
Using built-in specs.
Target: i586-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.3 --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=i586-suse-linux
Thread model: posix
gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux)


Building Étoilé with `make' I've got:

...

Build Project: OgreKit

Making all in subprojects of framework OgreKit...
Making all in subprojects of subproject Source...
Making all for subproject RegularExpression...
 Compiling file OGRegularExpression.m ...
OGRegularExpression.m:22:5: error: #error HAVE_STDARG_H is not defined
OGRegularExpression.m:25:5: error: #error HAVE_STDARG_PROTOTYPES is not defined
cc1obj: warnings being treated as errors
OGRegularExpression.m: In function '-[OGRegularExpression initWithString:options:syntax:escapeCharacter:]':
OGRegularExpression.m:311: error: call to function 'onig_error_code_to_str' without a real prototype
/usr/include/oniguruma.h:715: note: 'onig_error_code_to_str' was declared here
make[5]: *** [obj/OGRegularExpression.m.o] Error 1
make[4]: *** [RegularExpression.all.subproject.variables] Error 2
make[3]: *** [Source.all.subproject.variables] Error 2
make[2]: *** [OgreKit.all.framework.variables] Error 2
make[1]: *** [internal-all] Error 2
make: *** [internal-all] Error 2

I've put these lines in OGRegularExpression.m before #import <oniguruma.h>:

#ifndef HAVE_STDARG_H
#   error HAVE_STDARG_H is not defined
#endif
#ifndef HAVE_STDARG_PROTOTYPES
#   error HAVE_STDARG_PROTOTYPES is not defined
#endif

so i get errors about HAVE_STDARG_* not being defined. If i define HAVE_STDARG_H OgreKit compiles.

It seems oniguruma.h is #import'ed twice in
Etoile/Frameworks/OgreKit/Source/OGRegularExpression.m -- once explicitly
and once with <OgreKit/OGRegularExpression.h>. I've removed #import <oniguruma.h> from
OGRegularExpression.m
and defined HAVE_STDARG_H in
OGRegularExpression.h.

Why HAVE_STDARG_H isn't defined?


Donatas

_______________________________________________
Etoile-discuss mailing list
Etoile-discuss@...
https://mail.gna.org/listinfo/etoile-discuss

Re: OgreKit

by David Chisnall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you must use HTML mail, please don't set the font size to  
'unreadably small'.  Point size six might be fine for you, but for  
humans reading it's very difficult.

On 21 Feb 2009, at 12:50, Donatas Petrauskas wrote:

> It seems oniguruma.h is #import'ed twice in
> Etoile/Frameworks/OgreKit/Source/OGRegularExpression.m -- once  
> explicitly
> and once with <OgreKit/OGRegularExpression.h>. I've removed #import
> <oniguruma.h> from OGRegularExpression.m
> and defined HAVE_STDARG_H in OGRegularExpression.h.

That is what #import is for.  It is like #include, but automatically  
prevents multiple-inclusion.

> Why HAVE_STDARG_H isn't defined?

Where is HAVE_STDARG_H needed?  Your error is on line 22 of  
OGRegularExpression.m, which is:

#import "OGRegularExpressionPrivate.h"

This header does not reference HAVE_STDARG_H, and neither do any other  
OgerKit headers (or other files for that matter).  This macro is also  
not found in the copy of oniguruma.h I have installed, from version  
5.9.1.

David

_______________________________________________
Etoile-discuss mailing list
Etoile-discuss@...
https://mail.gna.org/listinfo/etoile-discuss

Re: OgreKit

by Donatas Petrauskas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/2/25 David Chisnall <theraven@...>
>
> If you must use HTML mail, please don't set the font size to
> 'unreadably small'.  Point size six might be fine for you, but for
> humans reading it's very difficult.

I'm really sorry for that :)

> > Why HAVE_STDARG_H isn't defined?
>
> Where is HAVE_STDARG_H needed?  Your error is on line 22 of
> OGRegularExpression.m, which is:
>
> #import "OGRegularExpressionPrivate.h"
>
> This header does not reference HAVE_STDARG_H, and neither do any other
> OgerKit headers (or other files for that matter).  This macro is also
> not found in the copy of oniguruma.h I have installed, from version
> 5.9.1.

Maybe that is the problem, because mine copy of oniguruma.h has HAVE_STDARG_H:

#ifdef HAVE_STDARG_H
# ifndef  HAVE_STDARG_PROTOTYPES
#  define HAVE_STDARG_PROTOTYPES 1
# endif
#endif

...

#ifndef PV_
#ifdef HAVE_STDARG_PROTOTYPES
# define PV_(args) args
#else
# define PV_(args) ()
#endif
#endif

...

ONIG_EXTERN int onig_error_code_to_str PV_((OnigUChar* s, int
err_code, ...)); // line 715

and that's why i get this error:

Build Project: OgreKit

Making all in subprojects of framework OgreKit...
Making all in subprojects of subproject Source...
Making all for subproject RegularExpression...
 Compiling file NSString_OgreKitAdditions.m ...
 Compiling file OGRegularExpressionEnumeratorPrivate.m ...
 Compiling file OGAttributedString.m ...
 Compiling file OGRegularExpressionFormatter.m ...
 Compiling file OGMutableAttributedString.m ...
 Compiling file OGMutablePlainString.m ...
 Compiling file OGRegularExpressionMatch.m ...
 Compiling file OGRegularExpressionMatchPrivate.m ...
 Compiling file OGPlainString.m ...
 Compiling file OGRegularExpressionPrivate.m ...
 Compiling file OGRegularExpression.m ...
cc1obj: warnings being treated as errors
OGRegularExpression.m: In function ‘-[OGRegularExpression
initWithString:options:syntax:escapeCharacter:]’:
OGRegularExpression.m:302: error: call to function
‘onig_error_code_to_str’ without a real prototype
/usr/include/oniguruma.h:715: note: ‘onig_error_code_to_str’ was declared here
make[5]: *** [obj/OGRegularExpression.m.o] Error 1
make[4]: *** [RegularExpression.all.subproject.variables] Error 2
make[3]: *** [Source.all.subproject.variables] Error 2
make[2]: *** [OgreKit.all.framework.variables] Error 2
make[1]: *** [internal-all] Error 2
make: *** [internal-all] Error 2


Donatas

_______________________________________________
Etoile-discuss mailing list
Etoile-discuss@...
https://mail.gna.org/listinfo/etoile-discuss

Re: OgreKit

by David Chisnall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 26 Feb 2009, at 11:53, Donatas Petrauskas wrote:

> Maybe that is the problem, because mine copy of oniguruma.h has  
> HAVE_STDARG_H:
>
> #ifdef HAVE_STDARG_H
> # ifndef  HAVE_STDARG_PROTOTYPES
> #  define HAVE_STDARG_PROTOTYPES 1
> # endif
> #endif

Okay, I found this line, and now I'm confused.  Om my machine,  
HAVE_STDARG_PROTOTYPES is not being defined, but OgreKit still builds  
correctly.

gcc -E shows that the prototype is being expanded to:

extern
int onig_error_code_to_str ();

This ought to be triggering a warning, but somehow isn't.  Calling a  
function like this with more than zero parameters works, but is not  
encouraged.  Do you have any standard CFLAGS set which add to the  
normal warnings defined in the Étoilé makefile?  Note that we treat  
warnings as errors, so turning on additional warnings may stop the  
build from working for you.

The HAVE_STDARG_H thing looks like something that would need to be  
defined by autoconf, but in this case it is meaningless - the header  
is only using variadic function declarations when HAVE_STDARG_H is  
present, but this is incorrect.  Variadic function declarations are  
valid in all C dialects.  stdarg.h supersedes vararg.h, but you only  
need either for definitions of variadic functions, not for their  
definitions.  For now, you can try adding this line above the include  
for onguruma.h:

#define HAVE_STDARG_H 1

Please also file a bug with oniguruma.  They should not be testing for  
feature macros like this in a public header like this.

David



_______________________________________________
Etoile-discuss mailing list
Etoile-discuss@...
https://mail.gna.org/listinfo/etoile-discuss

Re: OgreKit

by Donatas Petrauskas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/2/26 David Chisnall <theraven@...>:
> Do you have any standard CFLAGS set which add to the
> normal warnings defined in the Étoilé makefile?

Actually, I don't know. How could I check this? `echo $CFLAGS' gives
nothing. I'm building it on default openSUSE 11.1 installation.

> Please also file a bug with oniguruma.  They should not be testing for
> feature macros like this in a public header like this.

Wrote a letter to developer. Haven't found bugzilla.


Donatas

_______________________________________________
Etoile-discuss mailing list
Etoile-discuss@...
https://mail.gna.org/listinfo/etoile-discuss

Re: OgreKit

by David Chisnall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you try running:

make messages=yes

And send me the gcc line that is causing the failure?

Also, what version of gcc are you using?

David

On 26 Feb 2009, at 13:35, Donatas Petrauskas wrote:

> 2009/2/26 David Chisnall <theraven@...>:
>>  Do you have any standard CFLAGS set which add to the
>> normal warnings defined in the Étoilé makefile?
>
> Actually, I don't know. How could I check this? `echo $CFLAGS' gives
> nothing. I'm building it on default openSUSE 11.1 installation.
>
>> Please also file a bug with oniguruma.  They should not be testing  
>> for
>> feature macros like this in a public header like this.
>
> Wrote a letter to developer. Haven't found bugzilla.
>
>
> Donatas
>
> _______________________________________________
> Etoile-discuss mailing list
> Etoile-discuss@...
> https://mail.gna.org/listinfo/etoile-discuss


_______________________________________________
Etoile-discuss mailing list
Etoile-discuss@...
https://mail.gna.org/listinfo/etoile-discuss

Re: OgreKit

by Donatas Petrauskas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/2/26 David Chisnall <theraven@...>:
> Can you try running:
>
> make messages=yes
>
> And send me the gcc line that is causing the failure?

gcc OGRegularExpression.m -c \
              -MMD -MP -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1
-DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -D_REENTRANT -fPIC -g -Wall
-DDEBUG -fno-omit-frame-pointer -DGSWARN -DGSDIAGNOSE -Wno-import -g
-fno-strict-aliasing -fgnu-runtime -Wno-import -Wno-import -Werror
-Wno-unused -Wno-implicit -fconstant-string-class=NSConstantString
-I/home/dop/tmp/Etoile/Build -I/home/dop/tmp/Etoile/Frameworks/OgreKit
-I/home/dop/tmp/Etoile/Frameworks/OgreKit/Headers -I../.. `onig-config
--cflags` -I../.. `onig-config --cflags` -I./../../derived_src -I.
-I/home/dop/GNUstep/Library/Headers
-I/usr/GNUstep/Local/Library/Headers
-I/usr/GNUstep/System/Library/Headers \
               -o obj/OGRegularExpression.m.o


> Also, what version of gcc are you using?

Output of `gcc -v':

Using built-in specs.
Target: i586-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3
--enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap
--with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.3
--enable-linux-futex --without-system-libunwind --with-cpu=generic
--build=i586-suse-linux
Thread model: posix
gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux)


Donatas

_______________________________________________
Etoile-discuss mailing list
Etoile-discuss@...
https://mail.gna.org/listinfo/etoile-discuss