Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 80673 - out of date source code
Summary: out of date source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: joe
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Lon Hohberger
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-29 17:36 UTC by d.binderman
Modified: 2015-01-08 00:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-02-18 21:46:16 UTC


Attachments (Terms of Use)

Description d.binderman 2002-12-29 17:36:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

I have just tried to compile package joe-2.9.7-7 from Redhat 8.0

I found that the new C keyword "restrict" is used as an identifier.

Here is an untested patch to shut up the compiler.

./usearch.h.old ./usearch.h
*** ./usearch.h.old	Sun Dec 15 18:02:47 2002
--- ./usearch.h	Sun Dec 15 18:02:54 2002
***************
*** 29,35 ****
  	P *markb, *markk;	/* Original marks */
  	int valid;		/* Set if original marks are a valid block */
  	long addr;		/* Addr of last replacement or -1 for none */
! 	int restrict;		/* Search restricted to marked block */
  };
  
  SRCH *mksrch PARAMS((char *pattern, char *replacement, int ignore, int backwards, int repeat, int replace, int rest));
--- 29,35 ----
  	P *markb, *markk;	/* Original marks */
  	int valid;		/* Set if original marks are a valid block */
  	long addr;		/* Addr of last replacement or -1 for none */
! 	int restricted;		/* Search restricted to marked block */
  };
  
  SRCH *mksrch PARAMS((char *pattern, char *replacement, int ignore, int backwards, int repeat, int replace, int rest));
./usearch.c.old ./usearch.c
*** ./usearch.c.old	Sun Dec 15 18:03:07 2002
--- ./usearch.c	Sun Dec 15 18:03:39 2002
***************
*** 148,154 ****
  	srch->markb = 0;
  	srch->markk = 0;
  	srch->valid = 0;
! 	srch->restrict = 0;
  	izque(SRCHREC, link, &srch->recs);
  	for (x = 0; x != 26; ++x)
  		srch->pieces[x] = 0;
--- 148,154 ----
  	srch->markb = 0;
  	srch->markk = 0;
  	srch->valid = 0;
! 	srch->restricted = 0;
  	izque(SRCHREC, link, &srch->recs);
  	for (x = 0; x != 26; ++x)
  		srch->pieces[x] = 0;
***************
*** 292,298 ****
  			break;
  			case 'k':
  			case 'K':
! 			srch->restrict = 1;
  			break;
  			case '0':
  			case '1':
--- 292,298 ----
  			break;
  			case 'k':
  			case 'K':
! 			srch->restricted = 1;
  			break;
  			case '0':
  			case '1':
***************
*** 488,496 ****
   * 1 if we're done
   */
  
! static int restrict(BW *bw, SRCH *srch)
  {
! 	if (!srch->valid || !srch->restrict)
  		return 0;
  	bw->cursor->xcol = piscol(bw->cursor);
  	if (srch->backwards)
--- 488,496 ----
   * 1 if we're done
   */
  
! static int restricted(BW *bw, SRCH *srch)
  {
! 	if (!srch->valid || !srch->restricted)
  		return 0;
  	bw->cursor->xcol = piscol(bw->cursor);
  	if (srch->backwards)
***************
*** 548,554 ****
  		return 1;
  	} else if (srch->rest || (srch->repeat != -1 && srch->replace)) {
  		if (srch->valid)
! 			switch (restrict(bw, srch)) {
  				case -1:
  				goto again;
  				case 1:
--- 548,554 ----
  		return 1;
  	} else if (srch->rest || (srch->repeat != -1 && srch->replace)) {
  		if (srch->valid)
! 			switch (restricted(bw, srch)) {
  				case -1:
  				goto again;
  				case 1:
***************
*** 561,567 ****
  		goto next;
  	} else if (srch->repeat != -1) {
  		if (srch->valid)
! 			switch (restrict(bw, srch)) {
  				case -1:
  				goto again;
  				case 1:
--- 561,567 ----
  		goto next;
  	} else if (srch->repeat != -1) {
  		if (srch->valid)
! 			switch (restricted(bw, srch)) {
  				case -1:
  				goto again;
  				case 1:
***************
*** 591,597 ****
  
  		case 1:
  	      bye:if (!srch->flg && !srch->rest) {
! 			if (srch->valid && srch->restrict)
  				msgnw(bw, "Not found (search restricted to marked block)");
  			else
  				msgnw(bw, "Not found");
--- 591,597 ----
  
  		case 1:
  	      bye:if (!srch->flg && !srch->rest) {
! 			if (srch->valid && srch->restricted)
  				msgnw(bw, "Not found (search restricted to marked block)");
  			else
  				msgnw(bw, "Not found");
***************
*** 601,607 ****
  
  		case 2:
  		if (srch->valid)
! 			switch (restrict(bw, srch)) {
  				case -1:
  				goto again;
  				case 1:
--- 601,607 ----
  
  		case 2:
  		if (srch->valid)
! 			switch (restricted(bw, srch)) {
  				case -1:
  				goto again;
  				case 1:


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. compile with a new C compiler, such as Compaq.
2.
3.
    

Additional info:

Comment 1 Lon Hohberger 2003-01-02 13:58:29 UTC
What compiler and version are you using?

Comment 2 Lon Hohberger 2003-01-02 14:00:33 UTC
[lhh@lon lhh]$ cat test.c
#include <stdio.h>

int
main(void)
{
        int restrict = 0;

        printf("Hello,world %d\n",restrict);

        return 0;
}
[lhh@lon lhh]$ gcc -Wall -ansi -pedantic -Werror test.c -o tester
[lhh@lon lhh]$ ./tester
Hello,world 0
[lhh@lon lhh]$ gcc --version
gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



Comment 3 Lon Hohberger 2003-01-02 14:05:27 UTC
Nevermind, got it.

[lhh@lon lhh]$ gcc -Wall -Wshadow -Werror --std=c99 -o tester test.c
test.c: In function `main':
test.c:6: parse error before '=' token
test.c:8: parse error before "restrict"



Comment 4 Lon Hohberger 2003-01-02 16:48:26 UTC
joe-2.9.7-11 should be available in rawhide soon.

There were also some other build problems on later versions of development
libraries/headers, as well as a locally defined getcontext() function which
shadowed getcontext(2).

Let me know if it works for you.




Comment 5 Lon Hohberger 2003-02-18 21:46:16 UTC
No warnings from rebuilds.  Closing.


Note You need to log in before you can comment on or make changes to this bug.