Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Postgres/src/tools/   (Postgres Database Version 18.4©)  Datei vom 11.4.2026 mit Größe 1 kB image not shown  

Quelle  find_static

  Sprache: C
 

#!/bin/sh

# src/tools/find_static

trap "ret=$?; rm -rf /tmp/$$; exit $ret" 0 1 2 3 15

# This script finds functions that are either never called, or
# should be static.
# Some functions, like library functions and debug_print functions,
# should remain unchanged.

# Run on a compiled source tree, from the top of the source tree

# My nm utility has 9 characters of address which I strip, then a 'type'
# character, with T as a text function, and U as an undefined function
# symbol, then the function name.

find . -name '[a-z]*.o' -type f -print | while read FILE
do nm $FILE | cut -c17-100 |awk '{printf "%s\t%s\t%s\n", "'"$FILE"'",$1,$2}'
done >/tmp/$$
dropdb debug
createdb debug
echo "
 create table debug (file text, scope char, func text);

 copy debug from '/tmp/"$$"';

 select  *
 into table debug2
 from  debug;

 create index idebug on debug(scope,func);
 create index idebug2 on debug2(func,scope);
 vacuum debug;
 vacuum debug2;

 update  debug2
 set  scope = '_'
 from  debug
 where  debug2.func = debug.func and
  debug2.scope = 'T' and debug.scope = 'U';

 delete  from debug2
 where  scope = '_';

 select  *
 from  debug2
 where scope = 'T' and func != 'main'
        order by file, func;
" |psql -X debug

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-08-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.