1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/03_be.htm

38 lines
5.7 KiB
HTML
Raw Permalink Normal View History

2024-04-01 10:24:07 +02:00
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Section 3.2.5</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="03_bdd.htm">
<LINK REL=UP HREF="03_b.htm">
<LINK REL=NEXT HREF="03_c.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="03_bdd.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="03_b.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="03_c.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>
3.2.5 Exceptional Situations in the Compiler</H2> <P>
<P>
<P>
<A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> and <A REL=DEFINITION HREF="f_cmp_fi.htm#compile-file"><B>compile-file</B></A> are permitted to signal errors and warnings, including errors due to compile-time processing of <TT>(eval-when (:compile-toplevel) ...)</TT> forms, macro expansion, and conditions signaled by the compiler itself. <P>
<A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>Conditions</I></A> of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_error.htm#error"><B>error</B></A> might be signaled by the compiler in situations where the compilation cannot proceed without intervention. <P>
In addition to situations for which the standard specifies that <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>conditions</I></A> of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_warnin.htm#warning"><B>warning</B></A> must or might be signaled, warnings might be signaled in situations where the compiler can determine that the consequences are undefined or that a run-time error will be signaled. Examples of this situation are as follows: violating type declarations, altering or assigning the value of a constant defined with <A REL=DEFINITION HREF="m_defcon.htm#defconstant"><B>defconstant</B></A>, calling built-in Lisp functions with a wrong number of arguments or malformed keyword argument lists, and using unrecognized declaration specifiers. <P>
The compiler is permitted to issue warnings about matters of programming style as conditions of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_style_.htm#style-warning"><B>style-warning</B></A>. Examples of this situation are as follows: redefining a function using a different argument list, calling a function with a wrong number of arguments, not declaring <A REL=DEFINITION HREF="d_ignore.htm#ignore"><B>ignore</B></A> of a local variable that is not referenced, and referencing a variable declared <A REL=DEFINITION HREF="d_ignore.htm#ignore"><B>ignore</B></A>. <P>
Both <A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> and <A REL=DEFINITION HREF="f_cmp_fi.htm#compile-file"><B>compile-file</B></A> are permitted (but not required) to <A REL=DEFINITION HREF="26_glo_e.htm#establish"><I>establish</I></A> a <A REL=DEFINITION HREF="26_glo_h.htm#handler"><I>handler</I></A> for <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>conditions</I></A> of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_error.htm#error"><B>error</B></A>. For example, they might signal a warning, and restart compilation from some <A REL=DEFINITION HREF="26_glo_i.htm#implementation-dependent"><I>implementation-dependent</I></A> point in order to let the compilation proceed without manual intervention. <P>
Both <A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> and <A REL=DEFINITION HREF="f_cmp_fi.htm#compile-file"><B>compile-file</B></A> return three values, the second two indicating whether the source code being compiled contained errors and whether style warnings were issued. <P>
Some warnings might be deferred until the end of compilation. See <A REL=DEFINITION HREF="m_w_comp.htm#with-compilation-unit"><B>with-compilation-unit</B></A>. <P>
<P><HR>The following <A REL=META HREF="../Front/X3J13Iss.htm">X3J13 cleanup issues</A>, <I>not part of the specification</I>, apply to this section:<P><UL><LI> <A REL=CHILD HREF="../Issues/iss068.htm">COMPILER-WARNING-STREAM</A><LI> <A REL=CHILD HREF="../Issues/iss065.htm">COMPILER-DIAGNOSTICS:USE-HANDLER</A><P></UL><HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>