🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Matt Costello Sat, 06 Dec 1986 06:40
file(1) does not recognize C code
#52
Author: Matt Costello
Date: Sat, 06 Dec 1986 06:40
30 lines
1521 bytes
The file program does not recognize most C programs as being
C, and instead calls them some sort of text file.  Part of
the problem is that file only looks at the first 512 bytes of
the input and since it skips comments and preprocessor lines
this conspires to prevent it from reaching actual C code.

Compounding this problem is that its table of valid C keywords
is missing "static", so the standard line
	static char SCCSid[] = "identifier string";
as the first C code at the top of a program will cause file(1)
to assume it is NOT C code.

SYSTEMS:
	BSD4.2
	SYSV.2
	(probably all)

REPEAT-BY:
	echo "static int a;" > /tmp/x.j
	file /tmp/x.j

FIX:
	Add the keyword "static" to the "c[]" table.

----
Matt Costello, matt@ncr-sd.SanDiego.NCR.COM (not registered yet)
	{sdcsvax,cbatt,dcdwest,nosc.ARPA,ihnp4}!ncr-sd!matt
-- 
Matt Costello, matt@ncr-sd.SanDiego.NCR.COM (not registered yet)
	{sdcsvax,cbatt,dcdwest,nosc.ARPA,ihnp4}!ncr-sd!matt
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads