Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #warning directive #170

Merged
merged 4 commits into from Feb 3, 2018

Conversation

@Headline
Copy link
Member

Headline commented Jan 16, 2018

Here's my test code along with compiler outputs. The first is how the current #error directive functions, and the second is the new #warning directive

/*
C:\Users\Micha\Desktop\New folder\sourcepawn\build\compiler\spcomp>spcomp test.sp
SourcePawn Compiler 1.10
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2017 AlliedModders LLC

test.sp(2) : fatal error 194: user error: testing 1 2 3


Compilation aborted.Code size:                0 bytes
Data size:                0 bytes
Stack/heap size:      16384 bytes
Total requirements:   16384 bytes

*/
#error testing 1 2 3 

int main()
{

}
/*
C:\Users\Micha\Desktop\New folder\sourcepawn\build\compiler\spcomp>spcomp test.sp
SourcePawn Compiler 1.10
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2017 AlliedModders LLC

test.sp(2) : warning 241: user warning: testing 1 2 3

Code size:               24 bytes
Data size:                0 bytes
Stack/heap size:      16384 bytes
Total requirements:   16408 bytes

1 Warning.
*/
#warning testing 1 2 3 

int main()
{

}

Fixes #169

Headline added 2 commits Jan 16, 2018
"#endscript", "#error", "#file", "#if", "#include", "#line", "#pragma",
"#tryinclude", "#undef",
"#endscript", "#error", "#warning", "#file", "#if", "#include",
"#line", "#pragma", "#tryinclude", "#undef",

This comment has been minimized.

Copy link
@asherkin

asherkin Jan 24, 2018

Member

Mystery tabs.

@@ -274,4 +274,5 @@ static const char *warnmsg[] = {
/*238*/ "'%s:' is an illegal cast; use view_as<%s>(expression)\n",
/*239*/ "'%s' is an illegal tag; use %s as a type\n",
/*240*/ "'%s:' is an old-style tag operation; use view_as<%s>(expression) instead\n",
/*241*/ "user warning: %s\n",

This comment has been minimized.

Copy link
@asherkin

asherkin Jan 24, 2018

Member

Can we use one of the unused ones?

This comment has been minimized.

Copy link
@Headline

Headline Jan 25, 2018

Author Member

I don't see why not, is it generally preferred to use the lowest unused spot?

This comment has been minimized.

Copy link
@asherkin

asherkin Jan 26, 2018

Member

Ya, preferred, but isn't super important.

This comment has been minimized.

Copy link
@KyleSanderson

KyleSanderson Jan 31, 2018

Member

Patching holes is definitely a nice to have.

This comment has been minimized.

Copy link
@Headline

Headline Jan 31, 2018

Author Member

Will do. I’ll probably commit in the coming days

@Headline Headline force-pushed the Headline:add-#warning branch from 8323e28 to 239b0f9 Feb 3, 2018
@Headline

This comment has been minimized.

Copy link
Member Author

Headline commented Feb 3, 2018

Alright. Let me know if there's anything else.

@dvander

<3 asherkin
@asherkin asherkin changed the title Add #warning directive (#169) Add #warning directive (Fixes #169) Feb 3, 2018
@asherkin asherkin changed the title Add #warning directive (Fixes #169) Add #warning directive Feb 3, 2018
@asherkin asherkin merged commit a4a717f into alliedmodders:master Feb 3, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Headline Headline deleted the Headline:add-#warning branch Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.