Skip to content

compiler warning and "one last thing" #6

@homonto

Description

@homonto

Hi, I started using your library for my project and there are 2 issues:

  • compiler warning:
warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   char*  key = "mykey";

when my assignment looks like this:

  char*  key = "mykey";
  cipher->setKey(key);

Program compiles but warnings are there - I am sure cleaner compilation would be better ;-)
Changing to:
char* key = (char*)"mykey";
solves the issue but the same is with regards to hardcoded declaration in Cipher.cpp

void Cipher::setKey(char * key) {
  privateCipherKey = key;
}
  • "one last thing": when text is declared as a key, it is visible in the output binary file - is there any way of assigning the key without seeing it in the bin file?

Btw: thank you for your great job!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions