Suspect code in Speech Tools

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Suspect code in Speech Tools
# 1  
Old 12-27-2009
Network Suspect code in Speech Tools

When ran configure for speech tools 1.2.96-beta (festival speech synthesis) on Slackware 13.0 seems it is erroneously coded.
This code sequence gets flagged 5 times Image in configure:
Code:
int main() {
int j= 
                #if __GNUC__ == 3 
                3;
                #endif 
; return 0; }
EOF

Will the following fix it?
Code:
int main() {
int j = 3;
return 0;
}

My C ++ has been replaced by classic C Imagebut maybe this is something else!!Image

Last edited by fpmurphy; 12-27-2009 at 11:29 PM.. Reason: added code tags
# 2  
Old 12-28-2009
2 Questions:
  1. What do you mean by "flagged"? Do you get an error or warning? If so, could you post the message?
  2. Is this code part of the configure script itself, or part of the package source?


---------- Post updated at 07:54 ---------- Previous update was at 07:50 ----------

Quote from the GCC documentation
Quote:
__GNUC__
__GNUC_MINOR__
__GNUC_PATCHLEVEL__
These macros are defined by all GNU compilers that use the C preprocessor: C, C++, Objective-C and Fortran. Their values are the major version, minor version, and patch level of the compiler, as integer constants. For example, GCC 3.2.1 will define __GNUC__ to 3, __GNUC_MINOR__ to 2, and __GNUC_PATCHLEVEL__ to 1. These macros are also defined if you invoke the preprocessor directly.
So your example seems to be a cheap trick to check the compiler version. The reason might be that there are some problems if it's compiled with GCC version 3, and this code disables/enables some compiler features or code parts that caused that problem.
# 3  
Old 12-28-2009
Suspect code in Speech Tools

configure runs to completion with no warning/errors (flags being either) displayed to console.
The recommended procedure is to make a change to lines 18 & 64 in config/config.
In speech-tools directory I then examined config.log (which is supposed to be the output of the configure script) where I found the following errors (I'll show only 1 for brevity but they are all identical. Here is the requested error from config.log (sorry I said configure earlier, which it is, but the error is shown in config.log):

Code:
configure: In function 'main':
configure:1114: error: expected expression before ';' token
configure:1110: warning: unused variable 'j'
configure: failed program was:
#line 1107 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
int j= 
                #if __GNUC__ == 2 && __GNUC_MINOR__ == 95
                3;
                #endif 
; return 0; }

My recollection is that C would not like the ";" preceeding the return nor the embedded comment in the assignment statement. Is that correct?
As you can see this is a consequence of the configure script running i.e. configure:...
An alternative of this is that some mods were not made at run time to configure that should have fixed this to prevent these "errors"

My initial running of configure (since there were no errors on standard output) was followed by a make. Make produced (standard out) errors for -fno-shared-data option for the gcc compiler because that option is not available for version 4.3.3 of gcc.
This is yet to be resolved but it was reportedly fixed for the Debian distro but I presume it was not fixed for the .tar.gz files (Debian, I believe uses rpm or similar).

Just as I posted above I vaguely remembered that note you made about version.release.patch. The is what I was referring to as an alternate. My group & I quit using macros back as they caused too much confusion, we abandoned them. Yeh, I know the management mantra!
Since this is looking for an earlier version what can be done?? If I am forced to back up to release 95 of festival I going to junk this.

Last edited by pludi; 01-02-2010 at 09:58 AM.. Reason: code tags, please...
# 4  
Old 12-28-2009
You're right, C doesn't like empty assignments. But in this case that's probably wanted because configure is using the __GNUC__ defines as a way to check whether it's using GNU C at all, and which version. Any other compiler won't set those defines at all, and those that set it define it with the current version information.

As for the "fix". Debian uses the .deb format (short for "Debian"), and sometimes modifies the software so that it will run. Slackware, OTOH, uses (almost) exclusively vanilla (unmodified) code. But you can try and apply the Debian fix yourself, the patch is available here
# 5  
Old 01-02-2010
Suspect code in Speech Tools

Pludi want to thank you for your help! I googled info on configure looking for what does this type of error mean as opposed to my direct query you responded to. Consequently, I learned not to use the configure file which comes with the package. Rather to run autoconf against configure.in then run that process's configure file. But alas I can't get a break. I am getting new errors which are are not for me resolvable since I cannot get a direct relationship between the error and cause. When I look back into configure where config.log points I am not finding what is flagged as the culprit and on and on whine!
The business about preprocessing may yield some info now that I know more about the options available for configure and make. Funny there was no man page for configure.
Thanks again
# 6  
Old 01-02-2010
Quote:
Originally Posted by slak0
[...]The business about preprocessing may yield some info now that I know more about the options available for configure and make. Funny there was no man page for configure.[...]
While often perceived as such, configure is not, and never was, a part of any UNIX standard. It's basically just a script that checks for certain capabilities in the building system, but there's no predefined options to influence that process, or even a definition of how that should be done. And since every package is responsible for it's own configure script (if it even has one) there can't be a system-wide man page for it.
# 7  
Old 01-02-2010
Suspect code in Speech Tools

I would beg to differ slightly with what you said about not predefined options. There are options. Just do ./configure --help. There are options to just do checking without setting up the makefile and a bunch of stuff. That was why I made the comment about not being a man page for it.
As to "how it should be done" look at this site:
http://www.linuxtutorialblog.com/pos...stall-tutorial
Apparently some of the developers have established some constraints for themselves when building configure scripts.
Told you I had been slogging about <);^)
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. AIX

Code analysis tools for C programs

Hi I need a list of code analysis tools for C programs, that can work on AIX environment such as : dynamic or static code analysis Code Complexity Measures Test Coverage Analyzer Unit tests profiling tools Source code formatter I've found several tools but not compatible with AIX... (0 Replies)
Discussion started by: SteAlma
0 Replies

2. UNIX for Advanced & Expert Users

I suspect that my NIC is working in hybridization mode?

Hi, all: The physical network interface card should drop the packets if it doesn't match the MAC address of the NIC. In my PC, however, the packets which shoud be dropped trigger the interrupt function of my own driver and are recieved as skb to be transfered to the upper layer! Why? How... (1 Reply)
Discussion started by: liklstar
1 Replies

3. Programming

Parallel computing for speech door access

Dear friend, Here im saathis, currently im doing my final year project in VB6. My project is speech door access system. Im using microsoft access 2007 as database platform which user detail and set password. User have to register first then they have to speech the password which fix in... (2 Replies)
Discussion started by: saathis
2 Replies

4. Shell Programming and Scripting

I suspect a simple quesion

I bet this is really simple but I can only find silly long solutions. Im trying to read the second word of each line in a file and pipe it out, in Win32 it looks something like: for /F "tokens=2" %%b in (file.txt) do etc.. Sorry for the probably dumbass question! (1 Reply)
Discussion started by: joe19oo.c
1 Replies

5. UNIX for Dummies Questions & Answers

Tools for alignment of code?

Hello, Do we have any freeware which helps in alignment of code wrt spaces, sections etc? Thanks (6 Replies)
Discussion started by: eagercyber
6 Replies

6. UNIX for Dummies Questions & Answers

Getting emials with SUSPECT: Prefix

I got some job running on Sun Unix system, which sends the email to outlook client on windows after completion. Few of the emails are coming with SUSPECT: prefixes. I am using unix command mailx to send the message. Messages are simple text Any idea on this Thanks Ashok (1 Reply)
Discussion started by: akrathi
1 Replies
Login or Register to Ask a Question