Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Problems with -Wall flag: msg#00012

search.snowball

Subject: Problems with -Wall flag

Hi all,

Thanks for all your work on Snowball!

FYI:

The C code produced by Snowball won't compile with these flags:
"-Wall -Wmissing-prototypes -Wmissing-declarations -Werror"

(We use these as part of a coding standard enforcement)

-Wall seems to be the culprit... and -Werror compounds the issue:

I would suggest these changes:

runtime/api.c ---- Fixes undefined calloc/free
Line 1: #include <stdlib.h>

compiler/space.c ---- Fixes "int format, pointer arg" warning
Line 58: if (DEBUG) printf("<-- %d\n", (unsigned int)p);
Line 69: if (DEBUG) printf("--> %d\n", (unsigned int)p);
Line 75: if (DEBUG) printf("%d --> %d\n", (unsigned int)p, (unsigned int)q);

compiler/analyser.c --- Fixes undefined 'exit'
Line 1: #include <stdlib.h>

compiler/generator.c -- Fixes undefined strlen
Line 1: #include <string.h>

compiler/driver.c -- Fixes undefined strlen
Line 1: #include <string.h>

libstemmer/libstemmer.c -- Undefined strcmp & malloc
Line 1 #include <stdlib.h>
Line 2 #include <string.h>

examples/stemwords.c +149 -- "warning: too few arguments for format"
fprintf(stderr, "language `%s' not available for stemming\n", "english");

I also get these errors in the C code generated:

src_c/stem_english.c: In function `r_prelude':
src_c/stem_english.c:376: warning: label `lab1' defined but not used

src_c/stem_finnish.c: In function `r_case':
src_c/stem_finnish.c:448: warning: unused variable `m'

src_c/stem_french.c: In function `french_stem':
src_c/stem_french.c:951: warning: unused variable `m'

src_c/stem_porter.c: In function `porter_stem':
src_c/stem_porter.c:514: warning: label `lab1' defined but not used

A stupid fix for 'unused variable m' would be:

compiler/generator.c
143 "int m = 0; m = z->l - z->c;");

It's easy enough to change these files.... just thought you might want to
know.

Thanks for your hard work on the Snowball suite!

Neal Richter
Knowledgebase Developer
RightNow Technologies, Inc.
Customer Service for Every Web Site
Office: 406-522-1485


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe