open-simh / simh

The Open SIMH simulators package
https://opensimh.org/
Other
473 stars 89 forks source link

egrep deprecation warning messages from sim_ether.c #161

Open racingmars opened 1 year ago

racingmars commented 1 year ago

My system has GNU grep 3.8.

>>> show version
VAX 11/780 simulator V4.0-0 Current
 [...]
    Host Platform:
        Compiler: GCC 12.2.0
        [...]
        OS: Linux daenerys 6.1.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 21 Dec 2022 22:27:55 +0000 x86_64 GNU/Linux
        [...]
        git commit id: ce791138
        git commit time: 2022-12-02T13:19:56+0100

I built from source with make vax780

The following vax780.ini reproduces the problem (I have an existing tap interface on my system named tapVAX):

set XU enable, TYPE=DELUA, MAC=08:00:2B:06:6A:00
attach XU tap:tapVAX

Expected behavior: no warning messages from the system tools simh is executing.

Actual behavior: many messages about using the deprecated egrep instead of grep -E.

Changing the egrep on lines 1786 and 1788 in sim_ether.c to grep -E prevents the warnings.

pkoning2 commented 1 year ago

Thanks. I wonder what the GNU folks were thinking when they perpetrated those warning messages. It seems like an extraordinarily bad idea. I wonder if sufficiently old Unices have "egrep" but not "grep -E". If so, the better solution would be to throw in another redirect of stderr to /dev/null (on the egrep command, not just on the ip or ifconfig command).

racingmars commented 1 year ago

Apparently "egrep" was never standardized by POSIX and "grep -E" was preferred at least as far back as the 1992 version of the POSIX spec, IEEE standard 1003.2-1992.

Sending the stderr of egrep to /dev/null could certainly be a safe option for now. I wonder if new versions of GNU grep are starting to loudly complain about it in preparation to actually drop installing the egrep wrapper shell script.

pkoning2 commented 1 year ago

Wow, it's a shell script? Bizarre, what a crude hack.. Mac OS just does these as hardlinks (those are BSD grep, not GNU).