[mythtv] [PATCH] fifowriter gcc 3.4

Eric Hattemer eric at hattenator.dyndns.org
Fri Jun 4 22:28:55 EDT 2004


Kenneth Aafløy wrote:

>Sure you'r compiler is not a bit behind? Tried some of the -std=xxx variables 
>as CFLAGS?
>
>  
>
I'm not sure what you mean by behind.  Its gcc 3.4.0 release (non-cvs) 
version.  I compiled one version myself, and grabbed the contrib rpm 
from mandrake.  Both give these errors.  From what I can tell, c++ 
compatible flags are -std=gnu++98, -std=c++98, and -ansi.  None of the C 
flags seem to apply.  They all fail. 

As for fifobuffer:

http://www.gnu.org/software/gcc/gcc-3.4/changes.html

When allocating an array with a new expression, GCC used to allow 
parentheses around the type name. This is actually ill-formed and it is 
now rejected:

	int* a = new (int)[10];    // error, not accepted anymore
	int* a = new int[10];      // OK




As for the RTjpeg:



The cast-as-lvalue extension has been removed for C++ and deprecated for 
C and Objective-C. In particular, code like this:

        int i;
        (char) i = 5;
        

or this:

        char *p;
        ((int *) p)++;
        

is no longer accepted for C++ and will not be accepted for C and 
Objective-C in a future version.





[eric at me libmythtv]$ g++ -c -pipe -Wall -W -O3 -march=pentiumpro 
-fomit-frame-pointer `freetype-config --cflags` -D_REENTRANT -fPIC  
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr/local\" -DMMX 
-DUSING_IVTV -DUSING_OSS -DUSING_XV -DQT_NO_DEBUG -DQT_THREAD_SUPPORT 
-DQT_SHARED -I/usr/lib/qt3/mkspecs/default -I. -I/usr/local/include 
-I../libmyth -I.. -Idvbdev -I../libavcodec -I/usr/lib/qt3//include -o 
fifowriter.o fifowriter.cpp -std=gnu++98
fifowriter.cpp: In constructor `FIFOWriter::FIFOWriter(int, bool)':
fifowriter.cpp:26: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:26: note: try removing the parentheses around the type-id
fifowriter.cpp:27: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:27: note: try removing the parentheses around the type-id
fifowriter.cpp:28: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:28: note: try removing the parentheses around the type-id

[eric at me libmythtv]$ g++ -c -pipe -Wall -W -O3 -march=pentiumpro 
-fomit-frame-pointer `freetype-config --cflags` -D_REENTRANT -fPIC  
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr/local\" -DMMX 
-DUSING_IVTV -DUSING_OSS -DUSING_XV -DQT_NO_DEBUG -DQT_THREAD_SUPPORT 
-DQT_SHARED -I/usr/lib/qt3/mkspecs/default -I. -I/usr/local/include 
-I../libmyth -I.. -Idvbdev -I../libavcodec -I/usr/lib/qt3//include -o 
fifowriter.o fifowriter.cpp -std=c++98
fifowriter.cpp: In constructor `FIFOWriter::FIFOWriter(int, bool)':
fifowriter.cpp:26: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:26: note: try removing the parentheses around the type-id
fifowriter.cpp:27: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:27: note: try removing the parentheses around the type-id
fifowriter.cpp:28: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:28: note: try removing the parentheses around the type-id

[eric at me libmythtv]$ g++ -c -pipe -Wall -W -O3 -march=pentiumpro 
-fomit-frame-pointer `freetype-config --cflags` -D_REENTRANT -fPIC  
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr/local\" -DMMX 
-DUSING_IVTV -DUSING_OSS -DUSING_XV -DQT_NO_DEBUG -DQT_THREAD_SUPPORT 
-DQT_SHARED -I/usr/lib/qt3/mkspecs/default -I. -I/usr/local/include 
-I../libmyth -I.. -Idvbdev -I../libavcodec -I/usr/lib/qt3//include -o 
fifowriter.o fifowriter.cpp -ansi
fifowriter.cpp: In constructor `FIFOWriter::FIFOWriter(int, bool)':
fifowriter.cpp:26: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:26: note: try removing the parentheses around the type-id
fifowriter.cpp:27: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:27: note: try removing the parentheses around the type-id
fifowriter.cpp:28: error: array bound forbidden after parenthesized type-id
fifowriter.cpp:28: note: try removing the parentheses around the type-id



So you may program by any standard you want, but it seems to me, your 
code may soon stop working.  Maybe the gcc people reversed this decision 
in CVS or for 3.4.1, but otherwise, you'd have to take this up with 
them.  I don't understand the resistance to this patch.  A typedef 
disappears well before runtime, right?  This patch doesn't hurt gcc <3.4 
people, but helps gcc >=3.4 people to compile mythtv without having to 
mod the files themselves.  If you can think of a better way around it, 
like an interesting way of removing the ()'s, submit that patch 
instead.  Otherwise, this one has seemed to work fine for me. 

-Eric Hattemer



More information about the mythtv-dev mailing list