Bug 80673 - out of date source code
out of date source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: joe (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Lon Hohberger
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-29 12:36 EST by d.binderman
Modified: 2015-01-07 19:02 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-18 16:46:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2002-12-29 12:36:27 EST
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 08:58:29 EST
What compiler and version are you using?
Comment 2 Lon Hohberger 2003-01-02 09:00:33 EST
[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 09:05:27 EST
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 11:48:26 EST
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 16:46:16 EST
No warnings from rebuilds.  Closing.

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