Hi,

I think using (void)write() should fix the warnings in osspartysh.c. 
This write goes to the local terminal which is supposed to work in all 
cases. Can you verify if this change works?

However ossphone should actually check for errors that occur during 
read/write and to report them.

Best regards,

Hannu
---------
Jon Roadley-Battin wrote:
> Hi,
>
> Recently Gentoo ~ARCH pushed out gcc-4.3.3 and one of the things it 
> enabled was -D_FORTIFY_SOURCE=2.
> Unfortunately within the osspartysh.c there is a couple of function 
> calls that causes gcc to catch a violation
>
>
> make[2]: Entering directory 
> `/var/tmp/portage/media-sound/oss-devel-9999/work/build/cmd/osspartysh'
> cc -ffreestanding -c -O -fno-common -fno-stack-protector -Wall -Werror 
> -DOSS_LITTLE_ENDIAN  -I../../include -I../../kernel/framework/include 
> -I../../kernel/OS/Linux -I../../kernel/nonfree/include -I../.. 
> -I/usr/src/uts/x86_64 osspartysh.c -o ./osspartysh.o
>
> cc1: warnings being treated as errors
> osspartysh.c: In function 'shell_loop':
> osspartysh.c:215: error: ignoring return value of 'write', declared with 
> attribute warn_unused_result
> osspartysh.c: In function 'pty_session':
>
> osspartysh.c:338: error: ignoring return value of 'mkstemp', declared with 
> attribute warn_unused_result
> make[2]: *** [osspartysh.o] Error 1
> make[2]: Leaving directory 
> `/var/tmp/portage/media-sound/oss-devel-9999/work/build/cmd/osspartysh'
>
> make[1]: *** [subdirs] Error 1
> make[1]: Leaving directory 
> `/var/tmp/portage/media-sound/oss-devel-9999/work/build/cmd'
> make: *** [subdirs] Error 1
>
> Likewise in a ossphone.c similar errors (warnings on non-fortified) for 
> read/writes
>
>
>
> All I did was declare the return of the lines in questions to a tmp variable 
> to keep gcc happy - I don't know if this is what you would want todo in 
> practice.
> Since more and more distro's are using -D_FORTIFY_SOURCE=2 by default its 
> probably good to nip this is the bud early on
>
>
> JonRB
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> oss-devel mailing list
> oss-devel@mailman.opensound.com
> http://mailman.opensound.com/mailman/listinfo/oss-devel

_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to