From 2820edd2797c42c99b666f411482126860c7943c Mon Sep 17 00:00:00 2001 From: jesusc Date: Mon, 9 Jun 2003 02:42:10 +0000 Subject: [PATCH] Added option --vc git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2682 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 6 +++ doc/sdccman.lyx | 85 ++++++++++++++++++++++++++++++++++++++++++ src/SDCCglobl.h | 1 + src/SDCCmain.c | 2 + support/Util/SDCCerr.c | 8 +++- 5 files changed, 100 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbfde422..5113d5ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-06-08 Jesus Calvino-Fraga + + * support/Util/SDCCerr.c, src/SDCCglobl.h, src/SDCCmain.c, doc/sdccman.lyx: + added option --vc, so sdcc errors and warnings are compatible with + Microsoft Visual Studio. + 2003-06-07 Jesus Calvino-Fraga * device/lib/_atof.c, device/lib/Makefile.in, device/include/stdlib.h, diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index 87f17f9c..553a0227 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -6288,6 +6288,30 @@ status Collapsed \series default Display the directories in the compiler's search path +\layout List +\labelwidthstring 00.00.0000 + + +\series bold +- +\begin_inset ERT +status Collapsed + +\layout Standard + +\backslash +/ +\end_inset + +-vc +\begin_inset LatexCommand \index{-\/-print-search-dirs} + +\end_inset + + +\series default + Display the errors and warnings using MSVC style, so you can use SDCC with + visual studio \layout Subsubsection Intermediate Dump Options @@ -9907,6 +9931,67 @@ standard error \end_inset . + I you happen to have visual studio installed in your windows machine, you + can use it to compile your sources using a custom build and the SDCC - +\emph on + +\begin_inset ERT +status Collapsed + +\layout Standard + +\backslash +/ +\end_inset + + +\emph default +-vc option. + Something like this should work: +\newline + +\newline + +\series bold +c: +\backslash +sdcc +\backslash +bin +\backslash +sdcc.exe - +\series default +\emph on + +\begin_inset ERT +status Collapsed + +\layout Standard + +\backslash +/ +\end_inset + + +\series bold +\emph default +-vc - +\series default +\emph on + +\begin_inset ERT +status Collapsed + +\layout Standard + +\backslash +/ +\end_inset + + +\series bold +\emph default +-model-large -c $(InputPath) \layout Section \pagebreak_top SDCC Technical Data diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index 3fff1577..72d75865 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -237,6 +237,7 @@ struct options int noCcodeInAsm; /* hide c-code from asm */ int iCodeInAsm; /* show i-code in asm */ int printSearchDirs; /* display the directories in the compiler's search path */ + int vc_err_style; /* errors and warnings are compatible with Micro$oft visual studio */ }; /* forward definition for variables accessed globally */ diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 11f5c261..0ee4c6da 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -120,6 +120,7 @@ char buffer[PATH_MAX * 2]; #define OPTION_NO_CCODE_IN_ASM "--no-c-code-in-asm" #define OPTION_ICODE_IN_ASM "--i-code-in-asm" #define OPTION_PRINT_SEARCH_DIRS "--print-search-dirs" +#define OPTION_MSVC_ERROR_STYLE "--vc" static const OPTION optionsTable[] = { @@ -219,6 +220,7 @@ optionsTable[] = { { 0, OPTION_NO_CCODE_IN_ASM, &options.noCcodeInAsm, "don't include c-code as comments in the asm file"}, { 0, OPTION_ICODE_IN_ASM, &options.iCodeInAsm, "include i-code as comments in the asm file"}, { 0, OPTION_PRINT_SEARCH_DIRS, &options.printSearchDirs, "display the directories in the compiler's search path"}, + { 0, OPTION_MSVC_ERROR_STYLE, &options.vc_err_style, "messages are compatible with Micro$oft visual studio"}, /* End of options */ { 0, NULL } }; diff --git a/support/Util/SDCCerr.c b/support/Util/SDCCerr.c index b21cc39d..ba502b6b 100644 --- a/support/Util/SDCCerr.c +++ b/support/Util/SDCCerr.c @@ -20,6 +20,7 @@ #include #include "SDCCerr.h" +#include "../../src/SDCCglobl.h" #define USE_STDOUT_FOR_ERRORS 0 @@ -433,8 +434,11 @@ void vwerror (int errNum, va_list marker) fatalError++ ; if ( filename && lineno ) { - fprintf(_SDCCERRG.out, "%s:%d: ",filename,lineno); - } else if (lineno) { + if(options.vc_err_style) + fprintf(_SDCCERRG.out, "%s(%d) : ",filename,lineno); + else + fprintf(_SDCCERRG.out, "%s:%d: ",filename,lineno); + } else if (lineno) { fprintf(_SDCCERRG.out, "at %d: ", lineno); } else { fprintf(_SDCCERRG.out, "-:0: "); -- 2.30.2