1.\" # 2.\" # Copyright (c) 2014, Juniper Networks, Inc. 3.\" # All rights reserved. 4.\" # This SOFTWARE is licensed under the LICENSE provided in the 5.\" # ../Copyright file. By downloading, installing, copying, or 6.\" # using the SOFTWARE, you agree to be bound by the terms of that 7.\" # LICENSE. 8.\" # Phil Shafer, July 2014 9.\" 10.Dd July, 2014 11.Dt LIBXO 3 12.Os 13.Sh NAME 14.Nm xolint 15.Nd detect errors in programs using xo_emit 16.Sh SYNOPSIS 17.Nm xolint 18.Op Fl c 19.Op Fl "C <flags>" 20.Op Fl "d" 21.Op Fl "D" 22.Op Fl "I" 23.Op Fl "p" 24.Op Fl "V" 25.Op Fl "X" 26.Op Ar files... 27.Sh DESCRIPTION 28xolint is a tool for reporting common mistakes in format strings 29in source code that invokes xo_emit(). It allows these errors 30to be diagnosed at build time, rather than waiting until runtime. 31.Pp 32xolint takes the one or more C files as arguments, and reports 33and errors, warning, or informational messages as needed. 34.Bl -tag -width "C <flags>" 35.It Fl c 36Invoke 'cpp' against the input file 37.It Fl "C <flags>" 38Flags that are passed to 'cpp 39.It Fl "d" 40Enable debug output 41.It Fl "D" 42Generate documentation for all xolint messages 43.It Fl "I" 44Generate a table of xo_info_t structures. 45.It Fl "p" 46Print the offending lines after the error message is displayed 47.It Fl "V" 48Do not report errors, but instead print a complete list of 49all field names, sorted alphabetically. The output can help spot 50inconsistencies and spelling errors. 51.It Fl "X" 52Extract samples from xolint, suitable for internal testing. 53.El 54.Pp 55Output message contain the source filename and line number, the 56class of the message, the message, and, if 57.Fl p 58is given, the 59line that contains the error: 60.Bd -literal -offset indent 61 % xolint -t xolint.c 62 xolint.c: 16: error: anchor format should be "%d" 63 16 xo_emit("{[:/%s}"); 64.Ed 65.Pp 66.Sh ADDITIONAL DOCUMENTATION 67.Pp 68Complete documentation can be found on github: 69.Bd -literal -offset indent 70http://juniper.github.io/libxo/libxo-manual.html 71.Ed 72.Pp 73libxo lives on github as: 74.Bd -literal -offset indent 75https://github.com/Juniper/libxo 76.Ed 77.Pp 78The latest release of libxo is available at: 79.Bd -literal -offset indent 80https://github.com/Juniper/libxo/releases 81.Ed 82.Sh SEE ALSO 83.Xr xo_emit 3 84.Sh HISTORY 85The 86.Fa libxo 87library was added in FreeBSD 10.1. 88.Sh AUTHOR 89Phil Shafer 90