Thu 14 May 2009 04:47:02 PM UTC, original submission:
There are a few compilation problems when compiled with gcc version 2.95.3 (admittedly, a rather aged version
of gcc). These are all minor issues with declaration syntax.
The files affected are:
libproto/pop/mbox.c
libproto/imap/folder.c
imap4d/id.c
sieve/sieve.c
Below are the output messages from the compilation failures and patches for each file that successfully correct the issues.
With these patches in place, the package compiles OK.
Could these changes be rolled into the source?
Thanks,
Granville Moore
Details
-------
libproto/pop/mbox.c
-------------------
mbox.c: In function `pop_writer':
mbox.c:672: parse error before `int'
mbox.c:673: `status' undeclared (first use in this function)
mbox.c:673: (Each undeclared identifier is reported only once
mbox.c:673: for each function it appears in.)
This is corrected by inserting a declaration for "status" and removing the in-line
declaration.
Patch:
---------------------------------------------------------------
- mbox.c.buggy Mon Dec 8 19:06:08 2008
--- mbox.c Thu May 14 15:01:03 2009
***************
static int
pop_writer (void iodata, char buf)
{
pop_data_t iop = iodata;
MU_DEBUG1 (iop->mbox->debug, MU_DEBUG_PROT, "%s\n", buf);
! int status = pop_writeline (iop, "%s\r\n", buf);
CHECK_ERROR (iop, status);
status = pop_write (iop);
CHECK_ERROR (iop, status);
--- 667,676 ----
static int
pop_writer (void iodata, char buf)
{
+ int status = 0;
pop_data_t iop = iodata;
MU_DEBUG1 (iop->mbox->debug, MU_DEBUG_PROT, "%s\n", buf);
! status = pop_writeline (iop, "%s\r\n", buf);
CHECK_ERROR (iop, status);
status = pop_write (iop);
CHECK_ERROR (iop, status);
-----------------------------------------------------------------------
libproto/imap/folder.c
----------------------
folder.c: In function `imap_writer':
folder.c:575: parse error before `int'
folder.c:577: `status' undeclared (first use in this function)
folder.c:577: (Each undeclared identifier is reported only once
folder.c:577: for each function it appears in.)
This is corrected by inserting a declaration for "status" and removing the in-line
declaration.
Patch:
-----------------------------------------------------------------
- folder.c.buggy Mon Dec 8 19:06:08 2008
--- folder.c Thu May 14 15:25:29 2009
***************
static int
imap_writer (void iodata, char buf)
{
f_imap_t iop = iodata;
MU_DEBUG2 (iop->folder->debug, MU_DEBUG_PROT, "g%s %s\n",
mu_umaxtostr (0, iop->seq), buf);
! int status = imap_writeline (iop, "g%s %s\r\n",
mu_umaxtostr (0, iop->seq++), buf);
CHECK_ERROR (iop, status);
status = imap_send (iop);
--- 569,579 ----
static int
imap_writer (void iodata, char buf)
{
+ int status = 0;
f_imap_t iop = iodata;
MU_DEBUG2 (iop->folder->debug, MU_DEBUG_PROT, "g%s %s\n",
mu_umaxtostr (0, iop->seq), buf);
! status = imap_writeline (iop, "g%s %s\r\n",
mu_umaxtostr (0, iop->seq++), buf);
CHECK_ERROR (iop, status);
status = imap_send (iop);
----------------------------------------------------------------------
imap4d/id.c
-----------
id.c: In function `imap4d_id':
id.c:177: parse error before `int'
id.c:180: `i' undeclared (first use in this function)
id.c:180: (Each undeclared identifier is reported only once
id.c:180: for each function it appears in.)
id.c:196: `outcnt' undeclared (first use in this function)
This is corrected by moving the declaration of i and outcnt to the start
of the function.
Patch:
-------------------------------------------------------------------------
- id.c.buggy Mon Dec 8 19:06:08 2008
--- id.c Thu May 14 16:02:28 2009
***************
--- 167,174 ----
int
imap4d_id (struct imap4d_command *command, imap4d_tokbuf_t tok)
{
+ int i;
+ int outcnt = 0;
int rc = eat_args (tok);
if (rc != RESP_OK)
return util_finish (command, rc, "Syntax error");
***************
{
mu_iterator_t itr;
mu_list_get_iterator (imap4d_id_list, &itr);
- int i;
- int outcnt = 0;
for (i = 0, mu_iterator_first (itr);
i < 30 && !mu_iterator_is_done (itr);
--- 176,181 ----
-------------------------------------------------------------------------
sieve/sieve.c
-------------
sieve.c: In function `cb_email':
sieve.c:278: parse error before `int'
sieve.c:279: `rc' undeclared (first use in this function)
sieve.c:279: (Each undeclared identifier is reported only once
sieve.c:279: for each function it appears in.)
This is corrected by inserting a declaration for "rc" and removing the in-line
declaration.
Patch:
-------------------------------------------------------------------------
- sieve.c.buggy Tue Dec 23 21:54:52 2008
--- sieve.c Thu May 14 16:06:45 2009
***************
static int
cb_email (mu_debug_t debug, void data, mu_config_value_t val)
{
if (mu_cfg_assert_value_type (val, MU_CFG_STRING, debug))
return 1;
! int rc = mu_set_user_email (val->v.string);
if (rc)
mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("Invalid email: %s"),
mu_strerror (rc));
--- 273,282 ----
static int
cb_email (mu_debug_t debug, void data, mu_config_value_t val)
{
+ int rc;
if (mu_cfg_assert_value_type (val, MU_CFG_STRING, debug))
return 1;
! rc = mu_set_user_email (val->v.string);
if (rc)
mu_cfg_format_error (debug, MU_DEBUG_ERROR, _("Invalid email: %s"),
mu_strerror (rc));
-------------------------------------------------------------------------
|